Update tooling/types to incorporate chainID in domain separators.

This commit is contained in:
Lawrence Forman
2019-03-21 11:14:42 -04:00
committed by Amir Bandeali
parent 964d8171dd
commit 4bbaa6b41c
3 changed files with 4 additions and 1 deletions

View File

@@ -100,12 +100,13 @@ export const constants = {
INFINITE_TIMESTAMP_SEC: new BigNumber(2524604400), // Close to infinite
ZERO_AMOUNT: new BigNumber(0),
EXCHANGE_DOMAIN_NAME: '0x Protocol',
EXCHANGE_DOMAIN_VERSION: '2',
EXCHANGE_DOMAIN_VERSION: '3.0.0',
DEFAULT_DOMAIN_SCHEMA: {
name: 'EIP712Domain',
parameters: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
},

View File

@@ -40,6 +40,7 @@ export const eip712Utils = {
domain: {
name: domain.name === undefined ? constants.EXCHANGE_DOMAIN_NAME : domain.name,
version: domain.version === undefined ? constants.EXCHANGE_DOMAIN_VERSION : domain.version,
chainId: domain.chainId,
verifyingContract: domain.verifyingContractAddress,
},
message,

View File

@@ -782,5 +782,6 @@ export interface PackageJSON {
export interface EIP712DomainWithDefaultSchema {
name?: string;
version?: string;
chainId: number;
verifyingContractAddress: string;
}