This content applies to WaaS 1.0 only. We highly recommend that you upgrade to WaaS 2.0.
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; theAuthorizercan indicate the specific functions that need to be executed by configuringflag
- from: the
msg.senderof the transaction (e.g. thefromvalue for aCobo Safe Accountwill be the contract address of Safe) - delegate: the
Delegatewho sent the transaction;Authorizerwill use this value to review whether the transaction is authorized - All 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
