Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on master is broken #27

Open
chihkaiyu opened this issue Jul 18, 2022 · 0 comments
Open

Test on master is broken #27

chihkaiyu opened this issue Jul 18, 2022 · 0 comments

Comments

@chihkaiyu
Copy link

The test is broken on master branch now even following the README. The minimum to fix this is altering domainType in the test file as below:

const domainType = [{
        name: "name",
        type: "string"
    },
    {
        name: "version",
        type: "string"
    },
-   {
-       name: "chainId",
-       type: "uint256"
-   },
    {
        name: "verifyingContract",
        type: "address"
    },
+   {
+       name: "salt",
+       type: "bytes32"
+   }
];

and domainData in the test file should be altered as below:

domainData = {
    name: "TestContract",
    version: "1",
    verifyingContract: testContract.address,
-   chainId: 99999
+   salt: "0x000000000000000000000000000000000000000000000000000000000000002A" // chainID: 42
};

But I suggest we add all fields (name, version, chainId, verifyingContract, salt) to it or at least don't use chain ID as salt.

  • string name the user readable name of signing domain, i.e. the name of the DApp or the protocol.
  • string version the current major version of the signing domain. Signatures from different versions are not compatible.
  • uint256 chainId the EIP-155 chain id. The user-agent should refuse signing if it does not match the currently active chain.
  • address verifyingContract the address of the contract that will verify the signature. The user-agent may do contract specific phishing prevention.
  • bytes32 salt an disambiguating salt for the protocol. This can be used as a domain separator of last resort.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant