Skip to content

DelegateApprovals

Description

This contract is used by the FeePool to enable users to permit other addresses to withdraw fees for them. In Oikos this was intended to allow mobile wallets to claim fees for a cold storage wallet.

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: DelegateApprovals.sol

Architecture


Inheritance Graph

DelegateApprovals inheritance graph


DelegateApprovals architecture graph

Details
  • FeePool: This contract allows the fee pool to delegate fee withdrawal approvals.

Variables


approval

Stores who has approved whom to perform actions. The double mapping allows each authoriser to have multiple delegates. A given delegate is authorised by an authoriser when approval[authoriser][delegate] is true.

Type: mapping(address => mapping(address => bool)) public


Functions


constructor

Initialises the inherited State instance.

Details

Signature

constructor(address _owner, address _associatedContract) public

Superconstructors


setApproval

Grants approval for a delegate to act on behalf of a given authoriser.

Details

Signature

setApproval(address authoriser, address delegate) external

Modifiers

Emits


withdrawApproval

Revokes the approval of a delegate to act on behalf of a given authoriser.

Details

Signature

withdrawApproval(address authoriser, address delegate) external

Modifiers

Emits


Events


Approval

The delegate was approved to act on the authoriser's behalf.

Signature: Approval(address indexed authoriser, address delegate)


WithdrawApproval

The delegate was disapproved to act on the authoriser's behalf.

Signature: WithdrawApproval(address indexed authoriser, address delegate)