Authorizer
Authorizer
is the core module in Cobo Safe
that is used to implement access controls.
All transactions sent by Delegates
via execTransaction()
must be approved by the Authorizer
before execution.
An Authorizer
has to implement the following interfaces:
preExecCheck: validate the transaction before it is executed (e.g., contract address, call method, parameters, ETH amount of the transaction)
postExecCheck: validate the transaction and its outcomes after it has been executed (e.g., changes in wallet balance, leverage ratio in a DeFi protocol)
preExecProcess: complete certain operations before the transaction is executed (e.g., recording the transaction amount)
postExecProcess: complete certain operations after the transaction has been executed
flag: the above four methods are not mandatory for an
Authorizer
; theAuthorizer
can indicate the specific functions that need to be executed by configuringflag
The following struct shows a transaction that is yet to be executed:
from: the
msg.sender
of the transaction (e.g. thefrom
value for aCobo Safe Account
will be the contract address of Safe)delegate: the
Delegate
who sent the transaction;Authorizer
will use this value to review whether the transaction is authorizedAll other fields have the same definition as that for
CallData
postExecCheck
has two additional parameters:
TransactionResult:
the status and output of a transaction after it has been executedAuthorizerReturnData:
data returned bypreExecCheck
Last updated