Permit can allow for gasless deposits
The depositWithERC20WithPermit
function is implemented in order to not require the user to issue a second transaction when directly depositing ERC-20 tokens, because they can instead supply a permit. However, it assumes that the permit is signed by msg.sender
, which means that a different sender cannot submit the permit.
The other use case for permits is to allow for gasless transactions — a user who does not hold any ETH can still authorize the deposit of an amount of an ERC-20 they hold into the Liquifier. This can be achieved by recovering the owner's address from the permit, or adding it to the PermitInput
struct and checking it against the signature, and then using that to transfer the ERC-20 and as the target of the eETH mint.
Although not required, adding this feature would allow for gasless deposits without significant changes to the contract.