Permit Approval
Permit support
The Items v2 standard supports the EIP-2612 which proposes the additional permit
method for making approvals by way of signed messages rather than direct transactions.
The following code can be used as an integration example of the permit operation at the Frontend level to obtain the off-chain signature.
According to this pattern, once the off-chain sign is generated the permit
function can be called by any address to execute the on-chain transaction. Through the permit
function the allowanced amount that the spender
address can spend is registered and saved in the Main Interface contract.
If the off-chain sign is correctly generated and signed by the owner but the permit
function is not executed (passing all the parameters related to the sign and explained here) the spender
address is not allowed to spend the owner's
ITEMs amount.
Since the transaction can be performed by anyone (once the signature is correctly signed by the owner
address), an ITEM v2 can be used to build also complex applications regarding gas-less transactions or meta-transactions that use a third party to execute the transaction and pay the gas fee.
Last updated