yearn / yearn-vaults-v3

GNU Affero General Public License v3.0
104 stars 37 forks source link

implement eip-1344 for permit #81

Closed banteg closed 2 years ago

banteg commented 2 years ago

problem

we initialize the domain separator once on init. if a new network splits from the one the contract is deployed on, permits could potentially be replayable, even if the new network uses a distinct chain id.

solution

compute the domain separator dynamically instead of reading it from storage.

references

pandadefi commented 2 years ago

Done on v2: https://github.com/yearn/yearn-vaults/pull/542/commits/054d2dc4cabc961bb4d5a1bd141f9e3806469eee