Skip to main content

EVC-Aware Contract Implementation Guide

EVC-aware Contract Implementation Guide

In order to leverage the EVC functionality, many contracts may benefit from being EVC-aware. Being EVC-aware means that the contract outsources the authentication to the EVC so that the EVC features like sub-accounts, operators and batching become available out of the box.

The easiest way to achieve that is to inherit from the EVCUtil contract and use _msgSender function to retrieve the "true" message sender. Note that this pattern plays nicely with the OpenZeppelin contracts which can be seen for example here or here. Note that the access-controlled functions are usually decorated with the onlyEVCAccountOwner modifier to ensure that they are only called by the account owner in the EVC context.