Delegated Account implementation
Brewit uses a flexible session key implementation (Smart Sessions) to allow users to create delegated account.Smart Sessions is authored by Biconomy and Rhinestone team.
It is a flexible session management validator implementation for smart accounts, providing granular access control using policies.
Read more about it here.
Select a policy and conditions
Select a policy and conditions to allow or disallow access to your account based on the type of permission you want to grant. Currently we support 2 types of policies:
- Full Access - Allow access to specific tokens to perform unlimited swap or spend operations. Brewit uses Sudo Policy for this.
- Limited Access - Allow access to specific tokens to perform limited spend operations. Brewit uses ERC20SpendingLimitPolicy for this.
Create a subaccount session
A session is needed to validate the transactions from the subaccount for these policies to work. We allow session validation using several session validators.
- Ownable Session Validator - This validator is used to validate the embedded wallet session of social/ email login auth providers.
- WebAuthn Passkey validator - This is slightly modified version of the original WebAuthn passkey validator to support the ISessionValidator.
Enable the smart session module
Once the session validator is set, we can create a subaccount session by enabling the smart session module on the smart account and adding the session details to enable the session.