-
Notifications
You must be signed in to change notification settings - Fork 26
ListAuthorizer
File: ListAuthorizer.sol
- This Module handles the authorization of several of the smart contract functions.
- It keeps a list of authorized addresses and implements the IAuthorizers abstract function
isAuthorized, necessary for theonlyAuthorizedmodifier in the base module contract. - The authorized addresses can be anything, ranging from an EOA to a Gnosis multisignature, keeping the module agnostic to the specific governance structure employed.
No modifiers were introduced in this contract.
1. isAuthorized
function isAuthorized(address _who) public view override returns (bool)This function returns whether an address is authorized to facilitate the current transaction.
Parameters
-
address _who-> The address on which to perform the check.
Return Data
- Whether address
_whois authorized to carry out the given transaction or not
2. getAmountAuthorized
function getAmountAuthorized() public view returns (unit)This function returns the number of authorized addresses
Return Data
- Number of authorized addresses.
1. addToAuthorized
function addToAuthorized(address _who) externalThis function adds a new address to the list of authorized addresses.
Parameters
-
address _who-> The address to add to the list of authorized addresses.
2. __ListAuthorizer_removeFromAuthorized
function __ListAuthorizer_removeFromAuthorized(address _who) publicThis function removes an address from the list of authorized addresses.
Parameters
-
address _who-> The address to remove from the list of authorized addresses.
3. removeFromAuthorized
function removeFromAuthorized(address _who) externalThis function removes an address from the list of authorized addresses.
Parameters
-
address _who-> The address to remove from the list of authorized addresses.
4. __ListAuthorizer_transferAuthorization
function __ListAuthorizer_transferAuthorization(address _from, address _to) publicThis function transfers authorization from the calling address to a new one.
Parameters
-
address _from-> The address to transfer the authorization from -
address _to-> The address to transfer the authorization to
5. transferAuthorization
function transferAuthorization(address _who) externalThis function transfers authorization from the calling address to a new one.
Parameters
-
address _who-> The address to transfer the authorization to
6. initialize
function initialize(IProposal proposal, Metadata memory metadata) externalThis function calls the __Module_init function from the Module.sol contract thus initializing the module.
Adds msg.sender as an authorized address and adds to the number of authorized addresses.
Parameter(s)
-
IProposal proposal-> The module's proposal instance. -
Metadata metadata-> The module's metadata.