# Signing ERC-2612 Permits

In early 2020, [EIP-2612](https://eips.ethereum.org/EIPS/eip-2612) (Ethereum Improvement Proposal) was proposed and changed the options of how interactions happen with smart contracts.\
\
DApps (decentralized applications like Reservoir Finance) use smart contracts to execute transactions, and you must give permission for the smart contract to transfer up to a certain amount of your token (called an allowance). In times past, the user would have to first sign a transaction and pay the gas fee for the smart contract to have the “allowance” to interact on the user’s behalf. This led to excessive gas waste, and a sometimes confusing interface, through which two transactions would have to be submitted just to have one swap/withdraw/deposit transaction process.\
\
Through the innovation of EIP-2612, there is now a standardized way for users to grant permission to smart contracts to spend their tokens and swap in a **single** transaction.

\
Reservoir Finance uses this method of approval to make your transactions more seamless, safe, and gas efficient.  <br>

### How does permit signing work on Reservoir Finance?

Reservoir Finance’s smart contracts verify that the Permit signature is valid every time you permit and sign a transaction.<br>

<figure><img src="/files/tCMdEgg3PcrT92dqPwU9" alt="" width="524"><figcaption><p>Before signing permit.</p></figcaption></figure>

You will see this “Permit and Swap” button when the dApp is asking for your permissions. Once you click or tap the button, you’ll be prompted by your connected wallet to approve your permit. In this example, we’ll be using the popular wallet [Metamask.  ](https://metamask.io/)

<figure><img src="/files/TGcuOw3xonAgWeMbzKaa" alt="" width="306"><figcaption><p>Metamask UI after Permit request</p></figcaption></figure>

You will see the wallet requesting a signature confirming the details of the requested permit, which will be validated with the smart contract. These data points are:

* owner: The address of the token owner who signed the message
* spender: The address of the spender contract who can transfer tokens on behalf of the owner
* value: The maximum amount of tokens that can be transferred by the spender
* nonce: A unique number that prevents replay attacks
* deadline: A timestamp after which the signature is invalid<br>

All of these are followed up by your wallet signature. You’ll then return to Reservoir Finance where you will find the button has changed to:

<div data-full-width="true"><figure><img src="/files/hYL7K5HvjX3EOVnHpHeP" alt=""><figcaption><p>Ready to swap, permit has been signed.</p></figcaption></figure></div>

For the safety of our users, the permit is approved for only thirty minutes, and the swap must be completed before then, or the permit will time out.&#x20;

From here proceed to confirm your swap details. When you’re ready to complete the swap, click or tap on the “Swap” button. You will be returned to your wallet where you will see the following:

<figure><img src="/files/F5pcTz6vDBSCG4iXRnQ4" alt="" width="259"><figcaption><p>Metamask swap confirmation UI</p></figcaption></figure>

Here you will confirm your swap details and gas to be paid for the transaction. Notice though, only one transaction will be submitted. There’s no longer a need for an additional approval transaction, as the data is held within your swap transaction. No more convoluted transaction history, and the extra gas fee is retained. Click or tap on the confirm button, and your swap will be completed and the refunds transferred into your wallet.&#x20;

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reservoir.fi/signing-erc-2612-permits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
