Links
Comment on page

Permission

The Permissive framework allows you to create and manage custom permissions for your Ethereum accounts. These permissions govern access to assets and interactions with smart contracts and dApps. Below is a brief explanation of the Permission struct, which defines the various parameters you can set when creating a permission.
/**
* @title Permission
* @author Flydexo - @Flydex0
* @notice A permission is made for a specific function of a specific contract
* @dev 1 operator = 1 permission set
* @dev 1 permission set = infinite permissions
*/
struct Permission {
// The address authorized to use this permission to make an userOperation on behalf of the account
address operator;
// The address that this permission permits to call
address to;
// The function that this permission permits to call on the to contract
bytes4 selector;
// see {AllowanceCalldata}
bytes allowed_arguments;
// If set, the userOperation won't pass unless the paymaster is equal to the permission's paymaster
address paymaster;
// The UNIX timestamp (seconds) when the permission is not valid anymore (0 = infinite)
uint48 validUntil;
// The UNIX timestamp when the permission becomes valid
uint48 validAfter;
// The maximum number of times + 1 this permission can be used (0 = infinite, 1 = 0, n = n - 1)
uint256 maxUsage;
// The address called to make additional checks on the userOperation, see {IDataValidator}
address dataValidator;
}
By configuring these parameters, you can create highly customized permissions tailored to your specific use case. The Permissive framework empowers you to manage access and interactions on the EVM with greater flexibility and control.