diff --git a/artifacts/token-idl.json b/artifacts/token-idl.json index 290e832..1867037 100644 --- a/artifacts/token-idl.json +++ b/artifacts/token-idl.json @@ -153,6 +153,66 @@ } ] }, + { + "name": "new_fungible_definition_with_authority", + "accounts": [ + { + "name": "definition_target_account", + "writable": false, + "signer": false, + "init": false + }, + { + "name": "holding_target_account", + "writable": false, + "signer": false, + "init": false + } + ], + "args": [ + { + "name": "name", + "type": "string" + }, + { + "name": "initial_supply", + "type": "u128" + }, + { + "name": "mint_authority", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + }, + { + "name": "set_authority", + "accounts": [ + { + "name": "definition_account", + "writable": false, + "signer": false, + "init": false + } + ], + "args": [ + { + "name": "new_authority", + "type": { + "option": { + "array": [ + "u8", + 32 + ] + } + } + } + ] + }, { "name": "print_nft", "accounts": [ @@ -194,6 +254,17 @@ "type": { "option": "account_id" } + }, + { + "name": "mint_authority", + "type": { + "option": { + "array": [ + "u8", + 32 + ] + } + } } ] }, diff --git a/programs/amm/src/tests.rs b/programs/amm/src/tests.rs index 3878b5e..ec17213 100644 --- a/programs/amm/src/tests.rs +++ b/programs/amm/src/tests.rs @@ -872,6 +872,7 @@ impl AccountWithMetadataForTests { name: String::from("test"), total_supply: BalanceForTests::lp_supply_init(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), }, @@ -897,6 +898,7 @@ impl AccountWithMetadataForTests { name: String::from("LP Token"), total_supply: MINIMUM_LIQUIDITY, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), }, @@ -914,6 +916,7 @@ impl AccountWithMetadataForTests { name: String::from("test"), total_supply: BalanceForTests::lp_supply_init(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), }, diff --git a/programs/ata/src/tests.rs b/programs/ata/src/tests.rs index 595cfdd..5fe6db3 100644 --- a/programs/ata/src/tests.rs +++ b/programs/ata/src/tests.rs @@ -41,6 +41,7 @@ fn definition_account() -> AccountWithMetadata { name: "TEST".to_string(), total_supply: 1000, metadata_id: None, + mint_authority: None, }), nonce: nssa_core::account::Nonce(0), }, diff --git a/programs/integration_tests/tests/amm.rs b/programs/integration_tests/tests/amm.rs index c76502c..5d6dc87 100644 --- a/programs/integration_tests/tests/amm.rs +++ b/programs/integration_tests/tests/amm.rs @@ -401,6 +401,7 @@ impl Accounts { name: String::from("test"), total_supply: Balances::token_a_supply(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -414,6 +415,7 @@ impl Accounts { name: String::from("test"), total_supply: Balances::token_b_supply(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -427,6 +429,7 @@ impl Accounts { name: String::from("LP Token"), total_supply: Balances::token_lp_supply(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -705,6 +708,7 @@ impl Accounts { name: String::from("LP Token"), total_supply: Balances::token_lp_supply_add(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -797,6 +801,7 @@ impl Accounts { name: String::from("LP Token"), total_supply: Balances::token_lp_supply_remove(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -810,6 +815,7 @@ impl Accounts { name: String::from("LP Token"), total_supply: 0, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -902,6 +908,7 @@ impl Accounts { name: String::from("LP Token"), total_supply: Balances::lp_supply_init(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -1390,6 +1397,7 @@ fn fungible_total_supply(account: &Account) -> u128 { name: _, total_supply, metadata_id: _, + mint_authority: _, } = definition else { panic!("expected fungible token definition") diff --git a/programs/integration_tests/tests/ata.rs b/programs/integration_tests/tests/ata.rs index 243ccd3..1403522 100644 --- a/programs/integration_tests/tests/ata.rs +++ b/programs/integration_tests/tests/ata.rs @@ -84,6 +84,7 @@ impl Accounts { name: String::from("Gold"), total_supply: 1_000_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -121,6 +122,7 @@ impl Accounts { name: String::from("Foreign Gold"), total_supply: 1_000_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -495,6 +497,7 @@ fn ata_burn() { name: String::from("Gold"), total_supply: 700_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } diff --git a/programs/integration_tests/tests/stablecoin.rs b/programs/integration_tests/tests/stablecoin.rs index c4cc276..cbc2a7e 100644 --- a/programs/integration_tests/tests/stablecoin.rs +++ b/programs/integration_tests/tests/stablecoin.rs @@ -108,6 +108,7 @@ impl Accounts { name: String::from("Gold"), total_supply: Balances::user_holding_init(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -133,6 +134,7 @@ impl Accounts { name: String::from("DAI"), total_supply: Balances::stablecoin_supply_init(), metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } diff --git a/programs/integration_tests/tests/token.rs b/programs/integration_tests/tests/token.rs index fd7bbf8..08ee6bd 100644 --- a/programs/integration_tests/tests/token.rs +++ b/programs/integration_tests/tests/token.rs @@ -61,6 +61,7 @@ impl Accounts { name: String::from("Gold"), total_supply: 1_000_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -74,6 +75,7 @@ impl Accounts { name: String::from("Gold"), total_supply: 1_000_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -164,6 +166,7 @@ fn token_new_fungible_definition() { name: String::from("Gold"), total_supply: 1_000_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(1), } @@ -415,6 +418,7 @@ fn token_burn() { name: String::from("Gold"), total_supply: 800_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), } @@ -464,6 +468,7 @@ fn token_mint() { name: String::from("Gold"), total_supply: 1_500_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(1), } @@ -585,6 +590,7 @@ fn token_mint_fresh_authorized_public_recipient() { name: String::from("Gold"), total_supply: 1_500_000_u128, metadata_id: None, + mint_authority: None, }), nonce: Nonce(1), } diff --git a/programs/stablecoin/src/tests.rs b/programs/stablecoin/src/tests.rs index 41e0154..69b706a 100644 --- a/programs/stablecoin/src/tests.rs +++ b/programs/stablecoin/src/tests.rs @@ -79,6 +79,7 @@ fn collateral_definition_account() -> AccountWithMetadata { name: "SNT".to_owned(), total_supply: 1_000_000, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), }, @@ -156,6 +157,7 @@ fn stablecoin_definition_account() -> AccountWithMetadata { name: "DAI".to_owned(), total_supply: 1_000_000, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), }, @@ -389,6 +391,7 @@ fn open_position_rejects_mismatched_token_definition() { name: "OTHER".to_owned(), total_supply: 1, metadata_id: None, + mint_authority: None, }), nonce: Nonce(0), },