-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set up test skeleton * import mpl bubblegum * basic cnft test set up * imported bubblegum crate * fulfill buy contract skeleton * add cnft transfer to fulfill buy * add collection offer creation in test * Add basic fulfill buy operation * successful cnft transfer * remove metadata rehash * fix CreatorRoyaltyConfig * add using canopyDepth and handling truncated proofs. test passes * pass metadata args in * fix passing metadata args * add collection metadata verification * add fee cacluation, shared escrow support, reinvest buy support * add creator verification and pay * fix full logic * pass basic test * clean up redudent args and log * use pub! macro * remove test skips * add allowlist verification * propgate error * fix collection verification for mcc * fix allowlist check test * add incorrect royalty test * clean up tests log * add comment * clean up unused parameters * use asset id as seed of sell state * compute creator hash using metadata args * address comments * skip ocp test * fix format --------- Co-authored-by: swimricky <[email protected]>
- Loading branch information
1 parent
64051f3
commit 1d4ccd5
Showing
21 changed files
with
3,330 additions
and
23 deletions.
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.