-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CNft] CNft Collection Offer #107
Merged
nothing0012
merged 36 commits into
me-foundation:main
from
JeremyLi28:chen/fulfill-cnft-buy
Nov 22, 2024
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6da4bae
set up test skeleton
JeremyLi28 0990f00
import mpl bubblegum
JeremyLi28 79df2f4
basic cnft test set up
JeremyLi28 0dff0f1
imported bubblegum crate
JeremyLi28 d1c1f96
fulfill buy contract skeleton
JeremyLi28 d3623c0
add cnft transfer to fulfill buy
JeremyLi28 4aad3a2
add collection offer creation in test
JeremyLi28 d69ce2d
Add basic fulfill buy operation
JeremyLi28 06d7ec9
successful cnft transfer
JeremyLi28 c18508a
remove metadata rehash
JeremyLi28 dfb8b28
fix CreatorRoyaltyConfig
JeremyLi28 0108385
add using canopyDepth and handling truncated proofs. test passes
swimricky d436b60
Merge pull request #1 from JeremyLi28/ricky/fulfill-cnft-buy-fix-test
JeremyLi28 ad2f360
pass metadata args in
JeremyLi28 6e06918
fix passing metadata args
JeremyLi28 c58fdc8
add collection metadata verification
JeremyLi28 c9dc16c
add fee cacluation, shared escrow support, reinvest buy support
JeremyLi28 558bb62
add creator verification and pay
JeremyLi28 da09c32
fix full logic
JeremyLi28 a31d1be
pass basic test
JeremyLi28 f4b528c
clean up redudent args and log
JeremyLi28 d176b46
use pub! macro
JeremyLi28 4afc5ef
remove test skips
JeremyLi28 dfeb37b
add allowlist verification
JeremyLi28 460929e
propgate error
JeremyLi28 bfca62f
fix collection verification for mcc
JeremyLi28 affe611
fix allowlist check test
JeremyLi28 d7955f1
add incorrect royalty test
JeremyLi28 b08a8f1
clean up tests log
JeremyLi28 1f7ca41
add comment
JeremyLi28 42864c2
clean up unused parameters
JeremyLi28 573d61b
use asset id as seed of sell state
JeremyLi28 609e72e
compute creator hash using metadata args
JeremyLi28 7112056
address comments
JeremyLi28 a1ede67
skip ocp test
JeremyLi28 6cbe701
fix format
JeremyLi28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
use anchor_lang::{prelude::*, AnchorDeserialize, AnchorSerialize}; | ||
|
||
// Below types are copied from mpl bubblegum crate so | ||
// IDL will automatically include them | ||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] | ||
pub enum TokenStandard { | ||
NonFungible, | ||
FungibleAsset, | ||
Fungible, | ||
NonFungibleEdition, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq)] | ||
pub struct Collection { | ||
pub verified: bool, | ||
pub key: Pubkey, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] | ||
pub enum UseMethod { | ||
Burn, | ||
Multiple, | ||
Single, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq)] | ||
pub struct Uses { | ||
pub use_method: UseMethod, | ||
pub remaining: u64, | ||
pub total: u64, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] | ||
pub enum TokenProgramVersion { | ||
Original, | ||
Token2022, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq)] | ||
pub struct Creator { | ||
pub address: Pubkey, | ||
pub verified: bool, | ||
/// The percentage share. | ||
/// | ||
/// The value is a percentage, not basis points. | ||
pub share: u8, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone)] | ||
pub struct MetadataArgs { | ||
pub name: String, | ||
pub symbol: String, // Changed from Option<String> to String | ||
pub uri: String, | ||
pub seller_fee_basis_points: u16, | ||
pub primary_sale_happened: bool, // Changed from Option<bool> to bool | ||
pub is_mutable: bool, // Changed from Option<bool> to bool | ||
pub edition_nonce: Option<u8>, | ||
pub token_standard: Option<TokenStandard>, // Changed from Option<u8> to Option<TokenStandard> | ||
pub collection: Option<Collection>, | ||
pub uses: Option<Uses>, | ||
pub token_program_version: TokenProgramVersion, // Assuming TokenProgramVersion is a simple u8 | ||
pub creators: Vec<Creator>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pub mod metadata_args; | ||
pub mod sol_cnft_fulfill_buy; | ||
|
||
pub use metadata_args::*; | ||
pub use sol_cnft_fulfill_buy::*; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look into if we can pass in serialized data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried with serialize and deserialize, the deserilized data has some unknown issue that I couldn't figure out in short time (it fails allowlist check, means the deserialization had some issue). will keep the metadata args as it is for now to unblock this PR