Delegating¶
Stakers and traders can delegate the following actions to other accounts
- Burning (unstaking)
- Claiming
- Issuance (staking)
- Trading (exchanging)
- (All of the above)
Adding Approval API¶
Contract¶
Contract (address & ABI): DelegateApprovals
Methods¶
approveAllDelegatePowers(address delegate)
approveIssueOnBehalf(address delegate)
approveBurnOnBehalf(address delegate)
approveClaimOnBehalf(address delegate)
approveExchangeOnBehalf(address delegate)
Events Emitted¶
On a successful transaction, the following events occur:
name | emitted on | address authoriser |
address delegate |
bytes32 action |
---|---|---|---|---|
Approval |
DelegateApprovals |
msg.sender |
delegate |
One of ApproveAll, BurnForAddress, ClaimForAddress, IssueForAddress, ExchangeForAddress |
Examples from Mainnet¶
Withdrawing Approval API¶
Contract¶
Contract (address & ABI): DelegateApprovals
Methods¶
removeAllDelegatePowers(address delegate)
removeIssueOnBehalf(address delegate)
removeBurnOnBehalf(address delegate)
removeClaimOnBehalf(address delegate)
removeExchangeOnBehalf(address delegate)
Events Emitted¶
On a successful transaction, the following events occur:
name | emitted on | address authoriser |
address delegate |
bytes32 action |
---|---|---|---|---|
WithdrawApproval |
DelegateApprovals |
msg.sender |
delegate |
One of ApproveAll, BurnForAddress, ClaimForAddress, IssueForAddress, ExchangeForAddress |
Code Snippets¶
Delegating
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
No delegation in Solidity directly
Note: due to how calling works in Solidity, users must invoke these delegation functions themselves directly with the address of your contracts - the calling of these functions cannot be delegated themselves inside of Solidity. This is similar to how ERC20
approvals work (users must approve a contract to be able to transfer their tokens).