Use EIP-1191 next breaking change #3912
Replies: 2 comments
-
Can we do replay protection extension at the contract level and provide a stronger guarantee potentially? // constructor
deploymentChainId = block.chainid;
_DOMAIN_SEPARATOR = _calculateDomainSeparator(block.chainid);
/// ... Return the DOMAIN_SEPARATOR.
return block.chainid == deploymentChainId ? _DOMAIN_SEPARATOR : _calculateDomainSeparator(block.chainid);
/// ... IERC2612-permit abi.encode
block.chainid == deploymentChainId ? _DOMAIN_SEPARATOR : _calculateDomainSeparator(block.chainid), |
Beta Was this translation helpful? Give feedback.
-
Ethers.js and web3.js do not support this EIP. That is a strong reason to not adopt it in wagmi especially considering it comes with negative tradeoffs in the form of potential casing bugs/confusion. Will leave this open for now though but maybe we close this issue. |
Beta Was this translation helpful? Give feedback.
-
Wagmi does not pass the chainId into
getAddress
. Example:wagmi/packages/connectors/src/metaMask.ts
Line 113 in 8fc039d
Passing the chainId will overall be a better ux default but since it's a breaking change this change should happen on a breaking release
Links
EIP-1191: https://github.com/ethereum/ercs/blob/master/ERCS/erc-1191.md
getAddress: https://viem.sh/docs/utilities/getAddress#chainid-optional
Beta Was this translation helpful? Give feedback.
All reactions