mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-03 05:29:50 +00:00
Addresses @0x-r4bbit's review:
- lez-authority now provides an Authority(Option<[u8;32]>) newtype and an
Ownable trait (require_owner / transfer_ownership / renounce_ownership);
programs embed the authority slot in their account type instead of calling
a wrapper. Replaces the old AuthoritySlot.
- TokenDefinition::Fungible embeds authority: Authority; TokenDefinition
implements Ownable.
- Fold mint authority into NewFungibleDefinition { mint_authority: Option<AccountId> };
remove the separate NewFungibleDefinitionWithAuthority instruction.
- mint/set_authority authorize against the definition account itself (its id
must match the stored authority and be authorized in the tx), restoring the
2-account mint shape and supporting PDA authorities.
- Fix AMM: the pool-definition PDA is now the LP token's mint authority, so the
AMM mints LP at creation and on add-liquidity (was permanently revoked).
- Instruction params use AccountId; remove LP-0013-specific comments.
- Regenerate token/amm/ata/stablecoin IDLs.
Tests: lez-authority 8, token unit 56, token/amm/stablecoin/ata integration all
green under RISC0_DEV_MODE=1; fmt + clippy clean.
345 lines
6.9 KiB
JSON
345 lines
6.9 KiB
JSON
{
|
|
"version": "0.1.0",
|
|
"name": "token",
|
|
"instructions": [
|
|
{
|
|
"name": "transfer",
|
|
"accounts": [
|
|
{
|
|
"name": "sender",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": false
|
|
},
|
|
{
|
|
"name": "recipient",
|
|
"writable": true,
|
|
"signer": false,
|
|
"init": false
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "amount_to_transfer",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "new_fungible_definition",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_target_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
},
|
|
{
|
|
"name": "holding_target_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "total_supply",
|
|
"type": "u128"
|
|
},
|
|
{
|
|
"name": "mint_authority",
|
|
"type": {
|
|
"option": "account_id"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "new_definition_with_metadata",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_target_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
},
|
|
{
|
|
"name": "holding_target_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
},
|
|
{
|
|
"name": "metadata_target_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "new_definition",
|
|
"type": {
|
|
"defined": "NewTokenDefinition"
|
|
}
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": {
|
|
"defined": "Box"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "initialize_account",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": false,
|
|
"signer": false,
|
|
"init": false
|
|
},
|
|
{
|
|
"name": "account_to_initialize",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
}
|
|
],
|
|
"args": []
|
|
},
|
|
{
|
|
"name": "burn",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"signer": false,
|
|
"init": false
|
|
},
|
|
{
|
|
"name": "user_holding_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": false
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "amount_to_burn",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "mint",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": false
|
|
},
|
|
{
|
|
"name": "user_holding_account",
|
|
"writable": true,
|
|
"signer": false,
|
|
"init": false
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "amount_to_mint",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "set_authority",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": false,
|
|
"signer": false,
|
|
"init": false
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "new_authority",
|
|
"type": {
|
|
"option": "account_id"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "print_nft",
|
|
"accounts": [
|
|
{
|
|
"name": "master_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": false
|
|
},
|
|
{
|
|
"name": "printed_account",
|
|
"writable": true,
|
|
"signer": true,
|
|
"init": true
|
|
}
|
|
],
|
|
"args": []
|
|
}
|
|
],
|
|
"accounts": [
|
|
{
|
|
"name": "TokenDefinition",
|
|
"type": {
|
|
"kind": "enum",
|
|
"variants": [
|
|
{
|
|
"name": "Fungible",
|
|
"fields": [
|
|
{
|
|
"name": "name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "total_supply",
|
|
"type": "u128"
|
|
},
|
|
{
|
|
"name": "metadata_id",
|
|
"type": {
|
|
"option": "account_id"
|
|
}
|
|
},
|
|
{
|
|
"name": "authority",
|
|
"type": {
|
|
"defined": "Authority"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "NonFungible",
|
|
"fields": [
|
|
{
|
|
"name": "name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "printable_supply",
|
|
"type": "u128"
|
|
},
|
|
{
|
|
"name": "metadata_id",
|
|
"type": "account_id"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "TokenHolding",
|
|
"type": {
|
|
"kind": "enum",
|
|
"variants": [
|
|
{
|
|
"name": "Fungible",
|
|
"fields": [
|
|
{
|
|
"name": "definition_id",
|
|
"type": "account_id"
|
|
},
|
|
{
|
|
"name": "balance",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "NftMaster",
|
|
"fields": [
|
|
{
|
|
"name": "definition_id",
|
|
"type": "account_id"
|
|
},
|
|
{
|
|
"name": "print_balance",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "NftPrintedCopy",
|
|
"fields": [
|
|
{
|
|
"name": "definition_id",
|
|
"type": "account_id"
|
|
},
|
|
{
|
|
"name": "owned",
|
|
"type": "bool"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "TokenMetadata",
|
|
"type": {
|
|
"kind": "struct",
|
|
"fields": [
|
|
{
|
|
"name": "definition_id",
|
|
"type": "account_id"
|
|
},
|
|
{
|
|
"name": "standard",
|
|
"type": {
|
|
"defined": "MetadataStandard"
|
|
}
|
|
},
|
|
{
|
|
"name": "uri",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "creators",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "primary_sale_date",
|
|
"type": "u64"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"types": [
|
|
{
|
|
"name": "MetadataStandard",
|
|
"kind": "enum",
|
|
"variants": [
|
|
{
|
|
"name": "Simple"
|
|
},
|
|
{
|
|
"name": "Expanded"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"instruction_type": "token_core::Instruction"
|
|
}
|