Assigning Authority
1Money Network provides optional protocol level role assignment for token operations that can can be delegated by the Master Authority to other account addresses. The Master Authority always retains super admin rights over all roles.
Master Mint/Burn:
MasterMintBurnGrant/revoke minting/burning privileges, set mint limits (cannot mint directly)
Minting / Burning:
MintBurnTokensMint tokens (up to allowance), burn tokens from any account (cannot grant privileges)
Pausing / Unpausing:
PauseWhitelisting / Blacklisting:
ManageListMetadata management:
UpdateMetadata
Example Code:
// 4. Grant authority for Minting and Burning
println!("\n4. Grant Authority");
println!("==================");
let grant_payload = TokenAuthorityPayload {
recent_checkpoint: checkpoint_info.number,
chain_id,
nonce: current_nonce,
action: AuthorityAction::Grant,
authority_type: Authority::MintBurnTokens,
authority_address: recipient_address,
token: token_address,
value: TokenAmount::from(1000000000000000000u64), // 1 token allowance
};
current_nonce += 1; // Increment for next transaction
match client.grant_authority(grant_payload, private_key).await {
Ok(response) => {
println!("Authority granted - Tx: {}", response.hash);
}
Err(e) => {
print_detailed_error("Could not grant authority", &e);
}
}Last updated