mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-03 05:29:50 +00:00
- Add lez-authority crate: agnostic AuthoritySlot library (RFP-001) - Add mint_authority field to TokenDefinition::Fungible - Add NewFungibleDefinitionWithAuthority instruction - Add SetAuthority instruction (rotation + permanent revocation) - Update Mint to enforce authority guard - Wire new instructions into guest binary - Add 8 authority unit tests (53 total passing) - Add LP-0013 README, IDL, demo script, and example scripts
185 lines
4.2 KiB
JSON
185 lines
4.2 KiB
JSON
{
|
|
"name": "token_program",
|
|
"version": "0.1.0",
|
|
"description": "LEZ Token Program with mint authority support (LP-0013)",
|
|
"instructions": [
|
|
{
|
|
"name": "NewFungibleDefinition",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"description": "Token definition account (uninitialized)"
|
|
},
|
|
{
|
|
"name": "holding_account",
|
|
"writable": true,
|
|
"description": "Token holding account (uninitialized)"
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "total_supply",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "NewFungibleDefinitionWithAuthority",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"description": "Token definition account (uninitialized, authorized)"
|
|
},
|
|
{
|
|
"name": "holding_account",
|
|
"writable": true,
|
|
"description": "Token holding account (uninitialized, authorized)"
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "initial_supply",
|
|
"type": "u128"
|
|
},
|
|
{
|
|
"name": "mint_authority",
|
|
"type": {
|
|
"array": [
|
|
"u8",
|
|
32
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Mint",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"description": "Token definition account (initialized, authorized by mint authority)"
|
|
},
|
|
{
|
|
"name": "holding_account",
|
|
"writable": true,
|
|
"description": "Token holding account (initialized or uninitialized)"
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "amount_to_mint",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "SetAuthority",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"description": "Token definition account (initialized, authorized by current mint authority)"
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "new_authority",
|
|
"type": {
|
|
"option": {
|
|
"array": [
|
|
"u8",
|
|
32
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Transfer",
|
|
"accounts": [
|
|
{
|
|
"name": "sender_account",
|
|
"writable": true,
|
|
"description": "Sender token holding account (authorized)"
|
|
},
|
|
{
|
|
"name": "recipient_account",
|
|
"writable": true,
|
|
"description": "Recipient token holding account"
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "amount_to_transfer",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Burn",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": true,
|
|
"description": "Token definition account"
|
|
},
|
|
{
|
|
"name": "holding_account",
|
|
"writable": true,
|
|
"description": "Token holding account (authorized)"
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"name": "amount_to_burn",
|
|
"type": "u128"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "InitializeAccount",
|
|
"accounts": [
|
|
{
|
|
"name": "definition_account",
|
|
"writable": false,
|
|
"description": "Token definition account"
|
|
},
|
|
{
|
|
"name": "holding_account",
|
|
"writable": true,
|
|
"description": "Token holding account (uninitialized, authorized)"
|
|
}
|
|
],
|
|
"args": []
|
|
}
|
|
],
|
|
"errors": [
|
|
{
|
|
"code": 0,
|
|
"name": "AuthorityRevoked",
|
|
"msg": "Mint authority has been revoked; this token has a fixed supply"
|
|
},
|
|
{
|
|
"code": 1,
|
|
"name": "Unauthorized",
|
|
"msg": "Definition account authorization is missing; only the mint authority can mint"
|
|
},
|
|
{
|
|
"code": 2,
|
|
"name": "AlreadyRevoked",
|
|
"msg": "Mint authority already revoked; supply is permanently fixed"
|
|
}
|
|
]
|
|
} |