Open 0xnakato opened 1 year ago
Hello @0xnakato, thank you for reporting the issue!
We are aware of it and plan to implement the fix in the upcoming upgrade.
Hey @vladbochok, can i work on this issue?
Hey @vladbochok, can i work on this issue?
I recommend checking the following @0xnakato
Ensure that the domain separator is correctly set during the initialization of your contract. Verify that the data you’re signing is correctly formed according to the EIP-712 standard. Make sure the account used to sign the data is the same as the account used in the permit function
Hello, I'm testing the ERC20 permit feature with USDC and DAI on the zkSync Era testnet. However, a permit signature created with the token name will not work and returns the error
Invalid signature.
And it looks like the bridge token contract is not correctly initialized the ERC20PermitUpgradeable and only
ERC20Upgradeable
is initialized.https://github.com/matter-labs/era-contracts/blob/main/zksync/contracts/bridge/L2StandardERC20.sol#L82
The
DOMAIN_SEPARATOR()
of the testnet DAI token will return0x630ae2e0feb87df0136547b778ed1ad7bb1fdc555ac24d3a61b55432a339fe12
which is the exact value of the uninitialized domain separator.Example codes to generate the same/uninitialized domain separator https://gist.github.com/0xnakato/2c803385ac4c47c0455d6d0de105538f