DelegateApprovals¶
Description¶
Implemented in SIP 10: Upgrade Delegate Powers & SIP 14: Allow delegation of Synthetix Exchange function to another address
This contract is used by FeePool
, Synthetix
, to enable SNX holders (the delegator) to permit other addresses (the delegate) to perform actions on their befhalf including;
- Claim fees & rewards for them,
- Burn Synths on behalf or Burn to Target c-ratio on behalf
- Issue or IssueMax Synths on behalf
- Exchange Synths
In Synthetix this was intended to allow mobile or hot wallets such as metamask to claim fees for a cold storage wallet which can be done via the delegatr mobile dapp
In principle it is generic, as the approver just marks a number of delegates as authorised to perform some action on their behalf, with no reference to what that action is, or who the delegates are.
Source: contracts/DelegateApprovals.sol
Architecture¶
Related Contracts¶
Details
Variables¶
APPROVE_ALL
¶
Type: bytes32
BURN_FOR_ADDRESS
¶
Type: bytes32
CLAIM_FOR_ADDRESS
¶
Type: bytes32
EXCHANGE_FOR_ADDRESS
¶
Type: bytes32
ISSUE_FOR_ADDRESS
¶
Type: bytes32
eternalStorage
¶
Type: contract EternalStorage
Constructor¶
constructor
¶
Initialises the inherited State
instance.
Details
Signature
constructor(address _owner, contract EternalStorage _eternalStorage)
Visibility
public
State Mutability
``
Views¶
approvedAll
¶
Details
Signature
approvedAll(address authoriser, address delegate) view returns (bool)
Visibility
public
State Mutability
view
canBurnFor
¶
Details
Signature
canBurnFor(address authoriser, address delegate) view returns (bool)
Visibility
external
State Mutability
view
canClaimFor
¶
Details
Signature
canClaimFor(address authoriser, address delegate) view returns (bool)
Visibility
external
State Mutability
view
canExchangeFor
¶
Details
Signature
canExchangeFor(address authoriser, address delegate) view returns (bool)
Visibility
external
State Mutability
view
canIssueFor
¶
Details
Signature
canIssueFor(address authoriser, address delegate) view returns (bool)
Visibility
external
State Mutability
view
Restricted Functions¶
setEternalStorage
¶
Details
Signature
setEternalStorage(contract EternalStorage _eternalStorage)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
Internal Functions¶
_checkApproval
¶
Details
Signature
_checkApproval(bytes32 action, address authoriser, address delegate) view returns (bool)
Visibility
internal
State Mutability
view
_getKey
¶
Details
Signature
_getKey(bytes32 _action, address _authoriser, address _delegate) pure returns (bytes32)
Visibility
internal
State Mutability
pure
_setApproval
¶
Details
Signature
_setApproval(bytes32 action, address authoriser, address delegate)
Visibility
internal
State Mutability
``
Requires
Emits
_withdrawApproval
¶
Details
Signature
_withdrawApproval(bytes32 action, address authoriser, address delegate)
Visibility
internal
State Mutability
``
External Functions¶
approveAllDelegatePowers
¶
Details
Signature
approveAllDelegatePowers(address delegate)
Visibility
external
State Mutability
``
approveBurnOnBehalf
¶
Details
Signature
approveBurnOnBehalf(address delegate)
Visibility
external
State Mutability
``
approveClaimOnBehalf
¶
Details
Signature
approveClaimOnBehalf(address delegate)
Visibility
external
State Mutability
``
approveExchangeOnBehalf
¶
Details
Signature
approveExchangeOnBehalf(address delegate)
Visibility
external
State Mutability
``
approveIssueOnBehalf
¶
Details
Signature
approveIssueOnBehalf(address delegate)
Visibility
external
State Mutability
``
removeAllDelegatePowers
¶
Details
Signature
removeAllDelegatePowers(address delegate)
Visibility
external
State Mutability
``
removeBurnOnBehalf
¶
Details
Signature
removeBurnOnBehalf(address delegate)
Visibility
external
State Mutability
``
removeClaimOnBehalf
¶
Details
Signature
removeClaimOnBehalf(address delegate)
Visibility
external
State Mutability
``
removeExchangeOnBehalf
¶
Details
Signature
removeExchangeOnBehalf(address delegate)
Visibility
external
State Mutability
``
removeIssueOnBehalf
¶
Details
Signature
removeIssueOnBehalf(address delegate)
Visibility
external
State Mutability
``
Events¶
Approval
¶
The delegate was approved to act on the authoriser's behalf for the given action.
Signature: Approval(address authoriser, address delegate, bytes32 action)
EternalStorageUpdated
¶
The address of the eternal storage contract has changed.
Signature: EternalStorageUpdated(address newEternalStorage)
WithdrawApproval
¶
The delegate was disapproved to act on the authoriser's behalf.
Signature: WithdrawApproval(address authoriser, address delegate, bytes32 action)