Learn how to use Spend Permissions to allow a trusted spender to spend user assets
spender
that can move assets out of a user’s Base Account on their behalf.
After the user signs the permission, the spender
can initiate transfers within the limits you define — no additional prompts, pop-ups, or signatures needed from the user. This powers seamless experiences such as subscription renewals, algorithmic trading, and automated payouts.
Read more about the Spend Permission Manager contract and supported chains on GitHub.
Field Name | Type | Description |
---|---|---|
account | address | Smart account this spend permission is valid for |
spender | address | Entity that can spend account ’s tokens |
token | address | Token address (ERC-7528 native token or ERC-20 contract) |
allowance | uint160 | Maximum allowed value to spend within each period |
period | uint48 | Time duration for resetting used allowance on a recurring basis (seconds) |
start | uint48 | Timestamp this spend permission is valid starting at (inclusive, unix seconds) |
end | uint48 | Timestamp this spend permission is valid until (exclusive, unix seconds) |
salt | uint256 | Arbitrary data to differentiate unique spend permissions with otherwise identical fields |
extraData | bytes | Arbitrary data to attach to a spend permission which may be consumed by the spender |
prepareSpendCallData
with the permission and an amount
.prepareSpendCallData
returns an array of calls needed to spend the tokens:
approveWithSignature
— When the permission is not yet registered onchain, this call would be prepended to the spend
call.spend
— The call to spend the tokens.requestRevoke
.prepareRevokeCallData
.