diff --git a/contracts/coordinator/test/coordinator.ts b/contracts/coordinator/test/coordinator.ts index 26f29458e9..2369ac7797 100644 --- a/contracts/coordinator/test/coordinator.ts +++ b/contracts/coordinator/test/coordinator.ts @@ -112,7 +112,7 @@ describe('Coordinator tests', () => { makerFeeAssetData: assetDataUtils.encodeERC20AssetData(makerFeeToken.address), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(makerFeeToken.address), domain: { - verifyingContractAddress: exchange.address, + verifyingContract: exchange.address, chainId, }, }; diff --git a/contracts/coordinator/test/libs.ts b/contracts/coordinator/test/libs.ts index 66cf0100aa..3d9715dcee 100644 --- a/contracts/coordinator/test/libs.ts +++ b/contracts/coordinator/test/libs.ts @@ -47,7 +47,7 @@ describe('Libs tests', () => { signerAddress: constants.NULL_ADDRESS, data: '0x1234', domain: { - verifyingContractAddress: exchangeAddress, + verifyingContract: exchangeAddress, chainId, }, }; @@ -66,7 +66,7 @@ describe('Libs tests', () => { data: '0x1234', signature: '0x5678', domain: { - verifyingContractAddress: exchangeAddress, + verifyingContract: exchangeAddress, chainId, }, }; diff --git a/contracts/coordinator/test/mixins.ts b/contracts/coordinator/test/mixins.ts index d9947a82c3..0e4d256708 100644 --- a/contracts/coordinator/test/mixins.ts +++ b/contracts/coordinator/test/mixins.ts @@ -55,7 +55,7 @@ describe('Mixins tests', () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); [transactionSignerAddress, approvalSignerAddress1, approvalSignerAddress2] = accounts.slice(0, 3); exchangeDomain = { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId, }; defaultOrder = { diff --git a/contracts/coordinator/test/utils/approval_factory.ts b/contracts/coordinator/test/utils/approval_factory.ts index f0c5ea145d..8496d868f4 100644 --- a/contracts/coordinator/test/utils/approval_factory.ts +++ b/contracts/coordinator/test/utils/approval_factory.ts @@ -9,9 +9,9 @@ export class ApprovalFactory { private readonly _privateKey: Buffer; private readonly _verifyingContractAddress: string; - constructor(privateKey: Buffer, verifyingContractAddress: string) { + constructor(privateKey: Buffer, verifyingContract: string) { this._privateKey = privateKey; - this._verifyingContractAddress = verifyingContractAddress; + this._verifyingContractAddress = verifyingContract; } public newSignedApproval( diff --git a/contracts/coordinator/test/utils/hash_utils.ts b/contracts/coordinator/test/utils/hash_utils.ts index e6a128229d..54214cf3bd 100644 --- a/contracts/coordinator/test/utils/hash_utils.ts +++ b/contracts/coordinator/test/utils/hash_utils.ts @@ -6,13 +6,13 @@ import * as _ from 'lodash'; export const hashUtils = { getApprovalHashBuffer( transaction: SignedZeroExTransaction, - verifyingContractAddress: string, + verifyingContract: string, txOrigin: string, approvalExpirationTimeSeconds: BigNumber, ): Buffer { const typedData = eip712Utils.createCoordinatorApprovalTypedData( transaction, - verifyingContractAddress, + verifyingContract, txOrigin, approvalExpirationTimeSeconds, ); @@ -21,12 +21,12 @@ export const hashUtils = { }, getApprovalHashHex( transaction: SignedZeroExTransaction, - verifyingContractAddress: string, + verifyingContract: string, txOrigin: string, approvalExpirationTimeSeconds: BigNumber, ): string { const hashHex = `0x${hashUtils - .getApprovalHashBuffer(transaction, verifyingContractAddress, txOrigin, approvalExpirationTimeSeconds) + .getApprovalHashBuffer(transaction, verifyingContract, txOrigin, approvalExpirationTimeSeconds) .toString('hex')}`; return hashHex; }, diff --git a/contracts/dev-utils/test/order_validation_utils.ts b/contracts/dev-utils/test/order_validation_utils.ts index 0f95e8d2f1..9fbcf33f8e 100644 --- a/contracts/dev-utils/test/order_validation_utils.ts +++ b/contracts/dev-utils/test/order_validation_utils.ts @@ -121,7 +121,7 @@ describe('OrderValidationUtils/OrderTransferSimulatorUtils', () => { makerFeeAssetData: feeAssetData, takerFeeAssetData: feeAssetData, domain: { - verifyingContractAddress: exchange.address, + verifyingContract: exchange.address, chainId, }, }; diff --git a/contracts/exchange-forwarder/test/forwarder.ts b/contracts/exchange-forwarder/test/forwarder.ts index 5261b309b4..e960bf44ed 100644 --- a/contracts/exchange-forwarder/test/forwarder.ts +++ b/contracts/exchange-forwarder/test/forwarder.ts @@ -121,7 +121,7 @@ blockchainTests(ContractName.Forwarder, env => { makerFee: Web3Wrapper.toBaseUnitAmount(0, DECIMALS_DEFAULT), takerFee: Web3Wrapper.toBaseUnitAmount(0, DECIMALS_DEFAULT), domain: { - verifyingContractAddress: exchangeInstance.address, + verifyingContract: exchangeInstance.address, chainId, }, }; diff --git a/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts b/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts index b2bcdc2e00..e608726e47 100644 --- a/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts +++ b/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts @@ -17,7 +17,7 @@ blockchainTests('LibEIP712ExchangeDomain', env => { constants.NULL_ADDRESS, ); const domain = { - verifyingContractAddress: libEIP712ExchangeDomainContract.address, + verifyingContract: libEIP712ExchangeDomainContract.address, chainId, name: constants.EIP712_DOMAIN_NAME, version: constants.EIP712_DOMAIN_VERSION, @@ -28,17 +28,17 @@ blockchainTests('LibEIP712ExchangeDomain', env => { }); it('should calculate the correct domain hash when verifyingContractAddressIfExists is set to a non-null address', async () => { const chainId = 1; - const verifyingContractAddress = randomAddress(); + const verifyingContract = randomAddress(); const libEIP712ExchangeDomainContract = await TestLibEIP712ExchangeDomainContract.deployFrom0xArtifactAsync( artifacts.TestLibEIP712ExchangeDomain, env.provider, env.txDefaults, {}, new BigNumber(chainId), - verifyingContractAddress, + verifyingContract, ); const domain = { - verifyingContractAddress, + verifyingContract, chainId, name: constants.EIP712_DOMAIN_NAME, version: constants.EIP712_DOMAIN_VERSION, diff --git a/contracts/exchange-libs/test/lib_fill_results.ts b/contracts/exchange-libs/test/lib_fill_results.ts index 35d241506f..33fd4f3b3c 100644 --- a/contracts/exchange-libs/test/lib_fill_results.ts +++ b/contracts/exchange-libs/test/lib_fill_results.ts @@ -537,7 +537,7 @@ blockchainTests('LibFillResults', env => { expirationTimeSeconds: randomUint256(), salt: randomUint256(), domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 1337, // The chain id for the isolated exchange }, }; @@ -547,7 +547,7 @@ blockchainTests('LibFillResults', env => { } before(async () => { - ORDER_DEFAULTS.domain.verifyingContractAddress = libsContract.address; + ORDER_DEFAULTS.domain.verifyingContract = libsContract.address; }); it('should correctly calculate the results when only the right order is fully filled', async () => { @@ -1210,7 +1210,7 @@ blockchainTests('LibFillResults', env => { expirationTimeSeconds: randomUint256(), salt: randomUint256(), domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 1337, // The chain id for the isolated exchange }, }; @@ -1220,7 +1220,7 @@ blockchainTests('LibFillResults', env => { } before(async () => { - ORDER_DEFAULTS.domain.verifyingContractAddress = libsContract.address; + ORDER_DEFAULTS.domain.verifyingContract = libsContract.address; }); it('should transfer correct amounts when right order is fully filled', async () => { diff --git a/contracts/exchange-libs/test/lib_order.ts b/contracts/exchange-libs/test/lib_order.ts index 64b7865e68..f5a8451fd5 100644 --- a/contracts/exchange-libs/test/lib_order.ts +++ b/contracts/exchange-libs/test/lib_order.ts @@ -17,7 +17,7 @@ blockchainTests('LibOrder', env => { const EMPTY_ORDER: Order = { domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 0, }, senderAddress: constants.NULL_ADDRESS, @@ -67,7 +67,7 @@ blockchainTests('LibOrder', env => { ...EMPTY_ORDER, domain: { ...EMPTY_ORDER.domain, - verifyingContractAddress: libOrderContract.address, + verifyingContract: libOrderContract.address, }, }); }); @@ -75,7 +75,7 @@ blockchainTests('LibOrder', env => { it('should correctly hash a non-empty order', async () => { await testGetTypedDataHashAsync({ domain: { - verifyingContractAddress: libOrderContract.address, + verifyingContract: libOrderContract.address, chainId: 1337, }, senderAddress: randomAddress(), @@ -136,7 +136,7 @@ blockchainTests('LibOrder', env => { await testGetStructHashAsync({ // The domain is not used in this test, so it's okay if it is left empty. domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 0, }, senderAddress: randomAddress(), diff --git a/contracts/exchange-libs/test/lib_zero_ex_transaction.ts b/contracts/exchange-libs/test/lib_zero_ex_transaction.ts index bd398223b3..00d3446606 100644 --- a/contracts/exchange-libs/test/lib_zero_ex_transaction.ts +++ b/contracts/exchange-libs/test/lib_zero_ex_transaction.ts @@ -22,7 +22,7 @@ blockchainTests('LibZeroExTransaction', env => { signerAddress: constants.NULL_ADDRESS, data: constants.NULL_BYTES, domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 0, }, }; @@ -58,7 +58,7 @@ blockchainTests('LibZeroExTransaction', env => { ...EMPTY_TRANSACTION, domain: { ...EMPTY_TRANSACTION.domain, - verifyingContractAddress: libZeroExTransactionContract.address, + verifyingContract: libZeroExTransactionContract.address, }, }); }); @@ -72,7 +72,7 @@ blockchainTests('LibZeroExTransaction', env => { data: randomAssetData(), domain: { ...EMPTY_TRANSACTION.domain, - verifyingContractAddress: libZeroExTransactionContract.address, + verifyingContract: libZeroExTransactionContract.address, }, }); }); @@ -128,7 +128,7 @@ blockchainTests('LibZeroExTransaction', env => { data: randomAssetData(), // The domain is not used in this test, so it's okay if it is left empty. domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 0, }, }); diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index c3546a9c82..140a8db0ab 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -218,7 +218,7 @@ blockchainTests.resets('Exchange core', () => { makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), domain: { - verifyingContractAddress: exchange.address, + verifyingContract: exchange.address, chainId, }, }; diff --git a/contracts/exchange/test/internal.ts b/contracts/exchange/test/internal.ts index 765ccade09..670ecede9e 100644 --- a/contracts/exchange/test/internal.ts +++ b/contracts/exchange/test/internal.ts @@ -57,7 +57,7 @@ blockchainTests('Exchange core internal functions', env => { feeRecipientAddress: randomAddress(), expirationTimeSeconds: new BigNumber(_.random(0, 1e8)), domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 1337, // The chain id for the isolated exchange }, }; @@ -67,7 +67,7 @@ blockchainTests('Exchange core internal functions', env => { } before(async () => { - ORDER_DEFAULTS.domain.verifyingContractAddress = testExchange.address; + ORDER_DEFAULTS.domain.verifyingContract = testExchange.address; }); it('should revert if the maker asset multiplication should overflow', async () => { diff --git a/contracts/exchange/test/match_orders.ts b/contracts/exchange/test/match_orders.ts index 4b93ee7da3..1b52185b64 100644 --- a/contracts/exchange/test/match_orders.ts +++ b/contracts/exchange/test/match_orders.ts @@ -199,7 +199,7 @@ describe('matchOrders', () => { defaultERC721AssetAddress = erc721Token.address; defaultERC1155AssetAddress = erc1155Token.address; const domain = { - verifyingContractAddress: exchange.address, + verifyingContract: exchange.address, chainId, }; // Create default order parameters diff --git a/contracts/exchange/test/signature_validator.ts b/contracts/exchange/test/signature_validator.ts index b9f8f3b10d..b2d1377be9 100644 --- a/contracts/exchange/test/signature_validator.ts +++ b/contracts/exchange/test/signature_validator.ts @@ -436,7 +436,7 @@ blockchainTests.resets('MixinSignatureValidator', env => { makerFee: constants.ZERO_AMOUNT, takerFee: constants.ZERO_AMOUNT, domain: { - verifyingContractAddress: signatureValidator.address, + verifyingContract: signatureValidator.address, chainId, }, }; diff --git a/contracts/exchange/test/transactions.ts b/contracts/exchange/test/transactions.ts index 0845780665..3ce7b0517d 100644 --- a/contracts/exchange/test/transactions.ts +++ b/contracts/exchange/test/transactions.ts @@ -108,7 +108,7 @@ blockchainTests.resets('Exchange transactions', env => { defaultTakerFeeTokenAddress = takerFeeToken.address; domain = { - verifyingContractAddress: exchangeInstance.address, + verifyingContract: exchangeInstance.address, chainId, }; diff --git a/contracts/exchange/test/transactions_unit_tests.ts b/contracts/exchange/test/transactions_unit_tests.ts index 66c972d8ad..257bbf798d 100644 --- a/contracts/exchange/test/transactions_unit_tests.ts +++ b/contracts/exchange/test/transactions_unit_tests.ts @@ -21,7 +21,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef signerAddress: constants.NULL_ADDRESS, data: constants.NULL_BYTES, domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: 0, }, }; @@ -45,7 +45,7 @@ blockchainTests.resets('Transaction Unit Tests', ({ provider, web3Wrapper, txDef // Set the default domain. domain = { - verifyingContractAddress: transactionsContract.address, + verifyingContract: transactionsContract.address, chainId: 1337, }; }); diff --git a/contracts/exchange/test/utils/isolated_exchange_wrapper.ts b/contracts/exchange/test/utils/isolated_exchange_wrapper.ts index d030ed1479..43434ca4b4 100644 --- a/contracts/exchange/test/utils/isolated_exchange_wrapper.ts +++ b/contracts/exchange/test/utils/isolated_exchange_wrapper.ts @@ -102,7 +102,7 @@ export class IsolatedExchangeWrapper { public getOrderHash(order: Order): string { const domain = { - verifyingContractAddress: this.instance.address, + verifyingContract: this.instance.address, chainId: IsolatedExchangeWrapper.CHAIN_ID, }; return orderHashUtils.getOrderHashHex({ ...order, domain }); diff --git a/contracts/exchange/test/utils/order_factory_from_scenario.ts b/contracts/exchange/test/utils/order_factory_from_scenario.ts index 4074bb7a48..4a4ec073f5 100644 --- a/contracts/exchange/test/utils/order_factory_from_scenario.ts +++ b/contracts/exchange/test/utils/order_factory_from_scenario.ts @@ -431,7 +431,7 @@ export class OrderFactoryFromScenario { feeRecipientAddress, expirationTimeSeconds, domain: { - verifyingContractAddress: this._exchangeAddress, + verifyingContract: this._exchangeAddress, chainId: this._chainId, }, }; diff --git a/contracts/exchange/test/wrapper.ts b/contracts/exchange/test/wrapper.ts index 70916b43c4..7fc562c59a 100644 --- a/contracts/exchange/test/wrapper.ts +++ b/contracts/exchange/test/wrapper.ts @@ -98,7 +98,7 @@ blockchainTests.resets('Exchange wrappers', env => { makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), domain: { - verifyingContractAddress: exchange.address, + verifyingContract: exchange.address, chainId, }, }; diff --git a/contracts/exchange/test/wrapper_unit_tests.ts b/contracts/exchange/test/wrapper_unit_tests.ts index a071f95bc9..f9a231b71e 100644 --- a/contracts/exchange/test/wrapper_unit_tests.ts +++ b/contracts/exchange/test/wrapper_unit_tests.ts @@ -91,7 +91,7 @@ blockchainTests('Exchange wrapper functions unit tests.', env => { return orderHashUtils.getOrderHashHex({ ...order, domain: { - verifyingContractAddress: testContract.address, + verifyingContract: testContract.address, chainId: CHAIN_ID, }, }); diff --git a/contracts/extensions/test/balance_threshold_filter.ts b/contracts/extensions/test/balance_threshold_filter.ts index fc37812c26..a34a7bcba3 100644 --- a/contracts/extensions/test/balance_threshold_filter.ts +++ b/contracts/extensions/test/balance_threshold_filter.ts @@ -178,7 +178,7 @@ describe(ContractName.BalanceThresholdFilter, () => { takerFee: Web3Wrapper.toBaseUnitAmount(new BigNumber(150), DECIMALS_DEFAULT), senderAddress: erc721BalanceThresholdFilterInstance.address, domain: { - verifyingContractAddress: exchangeInstance.address, + verifyingContract: exchangeInstance.address, chainId, }, }; diff --git a/contracts/extensions/test/dutch_auction.ts b/contracts/extensions/test/dutch_auction.ts index 3ac3d4fa6a..7d1fdf44aa 100644 --- a/contracts/extensions/test/dutch_auction.ts +++ b/contracts/extensions/test/dutch_auction.ts @@ -164,7 +164,7 @@ describe(ContractName.DutchAuction, () => { makerFee: constants.ZERO_AMOUNT, takerFee: constants.ZERO_AMOUNT, domain: { - verifyingContractAddress: exchangeInstance.address, + verifyingContract: exchangeInstance.address, chainId, }, }; diff --git a/contracts/extensions/test/order_matcher.ts b/contracts/extensions/test/order_matcher.ts index 3c85875ccc..f5a0b1b9e5 100644 --- a/contracts/extensions/test/order_matcher.ts +++ b/contracts/extensions/test/order_matcher.ts @@ -167,7 +167,7 @@ describe('OrderMatcher', () => { ); const domain = { - verifyingContractAddress: exchange.address, + verifyingContract: exchange.address, chainId, }; diff --git a/contracts/test-utils/src/transaction_factory.ts b/contracts/test-utils/src/transaction_factory.ts index ab387d38c6..29edfcb0d6 100644 --- a/contracts/test-utils/src/transaction_factory.ts +++ b/contracts/test-utils/src/transaction_factory.ts @@ -37,7 +37,7 @@ export class TransactionFactory { expirationTimeSeconds: new BigNumber(currentBlockTimestamp).plus(tenMinutesInSeconds), gasPrice: new BigNumber(constants.DEFAULT_GAS_PRICE), domain: { - verifyingContractAddress: this._exchangeAddress, + verifyingContract: this._exchangeAddress, chainId: this._chainId, }, ...customTransactionParams, diff --git a/contracts/utils/test/lib_eip712.ts b/contracts/utils/test/lib_eip712.ts index e276e372b9..34c46eedbb 100644 --- a/contracts/utils/test/lib_eip712.ts +++ b/contracts/utils/test/lib_eip712.ts @@ -30,25 +30,25 @@ describe('LibEIP712', () => { * @param name The name of the domain. * @param version The version of the domain. * @param chainId The chain id of the domain. - * @param verifyingContractAddress The verifying contract address of the domain. + * @param verifyingContract The verifying contract address of the domain. */ async function testHashEIP712DomainAsync( name: string, version: string, chainId: number, - verifyingContractAddress: string, + verifyingContract: string, ): Promise { const expectedHash = signTypedDataUtils.generateDomainHash({ name, version, chainId, - verifyingContractAddress, + verifyingContract, }); const actualHash = await lib.externalHashEIP712DomainSeperator.callAsync( name, version, new BigNumber(chainId), - verifyingContractAddress, + verifyingContract, ); expect(actualHash).to.be.eq(hexConcat(expectedHash)); } diff --git a/packages/contract-wrappers/src/coordinator_wrapper.ts b/packages/contract-wrappers/src/coordinator_wrapper.ts index acd0740198..9b8a543e3c 100644 --- a/packages/contract-wrappers/src/coordinator_wrapper.ts +++ b/packages/contract-wrappers/src/coordinator_wrapper.ts @@ -686,7 +686,7 @@ export class CoordinatorWrapper { signerAddress, data, domain: { - verifyingContractAddress: this.exchangeAddress, + verifyingContract: this.exchangeAddress, chainId: await this._web3Wrapper.getChainIdAsync(), }, // HACK (xianny): arbitrary numbers for now diff --git a/packages/contract-wrappers/test/calldata_decoder_test.ts b/packages/contract-wrappers/test/calldata_decoder_test.ts index 6d4c6ac0ab..4377fbb8aa 100644 --- a/packages/contract-wrappers/test/calldata_decoder_test.ts +++ b/packages/contract-wrappers/test/calldata_decoder_test.ts @@ -40,7 +40,7 @@ describe('ABI Decoding Calldata', () => { const exchangeAddress = addressUtils.generatePseudoRandomAddress(); const feeRecipientAddress = addressUtils.generatePseudoRandomAddress(); const domain = { - verifyingContractAddress: exchangeAddress, + verifyingContract: exchangeAddress, chainId, }; // Create orders to match. diff --git a/packages/fill-scenarios/src/fill_scenarios.ts b/packages/fill-scenarios/src/fill_scenarios.ts index 58e56d5889..6c894d3987 100644 --- a/packages/fill-scenarios/src/fill_scenarios.ts +++ b/packages/fill-scenarios/src/fill_scenarios.ts @@ -124,7 +124,7 @@ export class FillScenarios { fillableAmount, ); const exchangeInstance = new ExchangeContract( - signedOrder.domain.verifyingContractAddress, + signedOrder.domain.verifyingContract, this._web3Wrapper.getProvider(), this._web3Wrapper.getContractDefaults(), ); diff --git a/packages/json-schemas/schemas/eip712_domain_schema.json b/packages/json-schemas/schemas/eip712_domain_schema.json index 3c5bbea89b..3b6c9ef1e3 100644 --- a/packages/json-schemas/schemas/eip712_domain_schema.json +++ b/packages/json-schemas/schemas/eip712_domain_schema.json @@ -8,7 +8,7 @@ }, "required": [ "chainId", - "verifyingContractAddress" + "verifyingContract" ], "type": "object" } diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 8975c3cfab..74f95bf539 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -220,7 +220,7 @@ describe('Schema', () => { feeRecipientAddress: NULL_ADDRESS, expirationTimeSeconds: '42', domain: { - verifyingContractAddress: NULL_ADDRESS, + verifyingContract: NULL_ADDRESS, chainId: CHAIN_ID, }, }; diff --git a/packages/order-utils/src/constants.ts b/packages/order-utils/src/constants.ts index 384adaa247..8ab303343d 100644 --- a/packages/order-utils/src/constants.ts +++ b/packages/order-utils/src/constants.ts @@ -107,7 +107,7 @@ export const constants = { { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, - { name: 'verifyingContractAddress', type: 'address' }, + { name: 'verifyingContract', type: 'address' }, ], }, EXCHANGE_ORDER_SCHEMA: { diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts index aa482c575e..94b08124e6 100644 --- a/packages/order-utils/src/eip712_utils.ts +++ b/packages/order-utils/src/eip712_utils.ts @@ -30,7 +30,7 @@ export const eip712Utils = { message: EIP712Object, domain: EIP712DomainWithDefaultSchema, ): EIP712TypedData => { - assert.isETHAddressHex('verifyingContractAddress', domain.verifyingContractAddress); + assert.isETHAddressHex('verifyingContract', domain.verifyingContract); assert.isString('primaryType', primaryType); const typedData = { types: { @@ -41,7 +41,7 @@ export const eip712Utils = { name: domain.name === undefined ? constants.EXCHANGE_DOMAIN_NAME : domain.name, version: domain.version === undefined ? constants.EXCHANGE_DOMAIN_VERSION : domain.version, chainId: domain.chainId, - verifyingContractAddress: domain.verifyingContractAddress, + verifyingContract: domain.verifyingContract, }, message, primaryType, @@ -75,7 +75,7 @@ export const eip712Utils = { */ createZeroExTransactionTypedData: (zeroExTransaction: ZeroExTransaction): EIP712TypedData => { assert.isNumber('domain.chainId', zeroExTransaction.domain.chainId); - assert.isETHAddressHex('domain.verifyingContractAddress', zeroExTransaction.domain.verifyingContractAddress); + assert.isETHAddressHex('domain.verifyingContract', zeroExTransaction.domain.verifyingContract); assert.doesConformToSchema('zeroExTransaction', zeroExTransaction, schemas.zeroExTransactionSchema); const normalizedTransaction = _.mapValues(zeroExTransaction, value => { return !_.isString(value) ? value.toString() : value; @@ -91,14 +91,14 @@ export const eip712Utils = { /** * Creates an Coordiantor typedData EIP712TypedData object for use with the Coordinator extension contract * @param transaction A 0x transaction - * @param verifyingContractAddress The coordinator extension contract address that will be verifying the typedData + * @param verifyingContract The coordinator extension contract address that will be verifying the typedData * @param txOrigin The desired `tx.origin` that should be able to submit an Ethereum txn involving this 0x transaction * @param approvalExpirationTimeSeconds The approvals expiration time * @return A typed data object */ createCoordinatorApprovalTypedData: ( transaction: SignedZeroExTransaction, - verifyingContractAddress: string, + verifyingContract: string, txOrigin: string, approvalExpirationTimeSeconds: BigNumber, ): EIP712TypedData => { @@ -106,7 +106,7 @@ export const eip712Utils = { ...transaction.domain, name: constants.COORDINATOR_DOMAIN_NAME, version: constants.COORDINATOR_DOMAIN_VERSION, - verifyingContractAddress, + verifyingContract, }; const transactionHash = transactionHashUtils.getTransactionHashHex(transaction); const approval = { diff --git a/packages/order-utils/src/exchange_revert_errors.ts b/packages/order-utils/src/exchange_revert_errors.ts index af35c7d680..d5118ffbb4 100644 --- a/packages/order-utils/src/exchange_revert_errors.ts +++ b/packages/order-utils/src/exchange_revert_errors.ts @@ -96,12 +96,12 @@ export class SignatureWalletError extends RevertError { } export class EIP1271SignatureError extends RevertError { - constructor(verifyingContractAddress?: string, data?: string, signature?: string, errorData?: string) { + constructor(verifyingContract?: string, data?: string, signature?: string, errorData?: string) { super( 'EIP1271SignatureError', - 'EIP1271SignatureError(address verifyingContractAddress, bytes data, bytes signature, bytes errorData)', + 'EIP1271SignatureError(address verifyingContract, bytes data, bytes signature, bytes errorData)', { - verifyingContractAddress, + verifyingContract, data, signature, errorData, diff --git a/packages/order-utils/src/order_factory.ts b/packages/order-utils/src/order_factory.ts index 6a41d3c4b3..66f266b381 100644 --- a/packages/order-utils/src/order_factory.ts +++ b/packages/order-utils/src/order_factory.ts @@ -53,7 +53,7 @@ export const orderFactory = { expirationTimeSeconds: createOrderOpts.expirationTimeSeconds || defaultCreateOrderOpts.expirationTimeSeconds, domain: { - verifyingContractAddress: exchangeAddress, + verifyingContract: exchangeAddress, chainId, }, }; @@ -118,7 +118,7 @@ function generateEmptyOrder(chainId: number): Order { feeRecipientAddress: constants.NULL_ADDRESS, expirationTimeSeconds: constants.INFINITE_TIMESTAMP_SEC, domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId, }, }; diff --git a/packages/order-utils/test/eip712_utils_test.ts b/packages/order-utils/test/eip712_utils_test.ts index 4082b6edc4..984c187e3e 100644 --- a/packages/order-utils/test/eip712_utils_test.ts +++ b/packages/order-utils/test/eip712_utils_test.ts @@ -20,14 +20,14 @@ describe('EIP712 Utils', () => { primaryType, { Test: [{ name: 'testValue', type: 'uint256' }] }, { testValue: '1' }, - { chainId: CHAIN_ID, verifyingContractAddress: constants.NULL_ADDRESS }, + { chainId: CHAIN_ID, verifyingContract: constants.NULL_ADDRESS }, ); expect(typedData.domain).to.not.be.undefined(); expect(typedData.types.EIP712Domain).to.not.be.undefined(); const domainObject = typedData.domain; expect(domainObject.name).to.eq(constants.EXCHANGE_DOMAIN_NAME); expect(domainObject.version).to.eq(constants.EXCHANGE_DOMAIN_VERSION); - expect(domainObject.verifyingContractAddress).to.eq(constants.NULL_ADDRESS); + expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS); expect(typedData.primaryType).to.eq(primaryType); }); it('adds in the EIP712DomainSeparator without default values', () => { @@ -42,7 +42,7 @@ describe('EIP712 Utils', () => { name: domainName, version: domainVersion, chainId: CHAIN_ID, - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, }, ); expect(typedData.domain).to.not.be.undefined(); @@ -50,7 +50,7 @@ describe('EIP712 Utils', () => { const domainObject = typedData.domain; expect(domainObject.name).to.eq(domainName); expect(domainObject.version).to.eq(domainVersion); - expect(domainObject.verifyingContractAddress).to.eq(constants.NULL_ADDRESS); + expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS); expect(typedData.primaryType).to.eq(primaryType); }); }); @@ -63,7 +63,7 @@ describe('EIP712 Utils', () => { data: constants.NULL_BYTES, signerAddress: constants.NULL_ADDRESS, domain: { - verifyingContractAddress: constants.NULL_ADDRESS, + verifyingContract: constants.NULL_ADDRESS, chainId: CHAIN_ID, }, }); @@ -72,7 +72,7 @@ describe('EIP712 Utils', () => { const domainObject = typedData.domain; expect(domainObject.name).to.eq(constants.EXCHANGE_DOMAIN_NAME); expect(domainObject.version).to.eq(constants.EXCHANGE_DOMAIN_VERSION); - expect(domainObject.verifyingContractAddress).to.eq(constants.NULL_ADDRESS); + expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS); }); }); }); diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts index 30376bf94d..76a0765c74 100644 --- a/packages/order-utils/test/order_hash_test.ts +++ b/packages/order-utils/test/order_hash_test.ts @@ -14,7 +14,7 @@ const expect = chai.expect; describe('Order hashing', () => { describe('#getOrderHashHex', () => { - const expectedOrderHash = '0xf64c4b90214e8bd27a7830356a276c45b88fe18e0960fbe5b480167abb23b944'; + const expectedOrderHash = '0x331cb7e07a757bae130702da6646c26531798c92bcfaf671817268fd2c188531'; const fakeExchangeContractAddress = '0x1dc4c1cefef38a777b15aa20260a54e584b16c48'; const fakeChainID = 50; const order: Order = { @@ -33,7 +33,7 @@ describe('Order hashing', () => { takerAssetAmount: new BigNumber(0), expirationTimeSeconds: new BigNumber(0), domain: { - verifyingContractAddress: fakeExchangeContractAddress, + verifyingContract: fakeExchangeContractAddress, chainId: fakeChainID, }, }; diff --git a/packages/order-utils/test/remaining_fillable_calculator_test.ts b/packages/order-utils/test/remaining_fillable_calculator_test.ts index 31a5c278bb..3bee3c0d65 100644 --- a/packages/order-utils/test/remaining_fillable_calculator_test.ts +++ b/packages/order-utils/test/remaining_fillable_calculator_test.ts @@ -60,7 +60,7 @@ describe('RemainingFillableCalculator', () => { salt: zero, expirationTimeSeconds: zero, domain: { - verifyingContractAddress: zeroAddress, + verifyingContract: zeroAddress, chainId, }, }; diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 76e237f601..78d7d7f5fc 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -42,13 +42,13 @@ describe('Signature utils', () => { takerAssetAmount: new BigNumber(0), expirationTimeSeconds: new BigNumber(0), domain: { - verifyingContractAddress: fakeExchangeContractAddress, + verifyingContract: fakeExchangeContractAddress, chainId: fakeChainId, }, }; transaction = { domain: { - verifyingContractAddress: fakeExchangeContractAddress, + verifyingContract: fakeExchangeContractAddress, chainId: fakeChainId, }, salt: generatePseudoRandomSalt(), @@ -188,7 +188,7 @@ describe('Signature utils', () => { describe('#ecSignOrderAsync', () => { it('should default to eth_sign if eth_signTypedData is unavailable', async () => { const expectedSignature = - '0x1c5e6c2a66037230b86a410b1d68108683ee8288d3668af91cab72dde1e1541ca86a50b638ccc743f6194a21dd313e71b4b155b2ad882f874d5d790d37d4623ca203'; + '0x1bea7883d76c4d8d0cd5915ec613f8dedf3b5f03e6a1f74aa171e700b0becdc8b47ade1ede08a5496ff31e34715bc6ac5da5aba709d3d8989a48127c18ef2f56d503'; const fakeProvider = { async sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): Promise { @@ -384,7 +384,7 @@ describe('Signature utils', () => { }); it('should return the correct signature for signatureHex concatenated as R + S + V', async () => { const expectedSignature = - '0x1c686a55fa3f563115c0f2bc2b1c51964d0b6a05dd5ee862b702275600b7f634970f2275dccc1073f87a916dfde88574385b2d7a3eed0c2bdc08c76bad748d7d9002'; + '0x1b65b7b6205a4511cc81ec8f1b3eb475b398d60985089a3041c74735109f207e99542c7f0f81b0a988317e89b8280ec72829c8532a04c376f1f1236589c911545002'; const fakeProvider = { async sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): Promise { if (payload.method === 'eth_signTypedData') { diff --git a/packages/order-utils/test/transaction_hash_test.ts b/packages/order-utils/test/transaction_hash_test.ts index c85883b4d1..56975658f7 100644 --- a/packages/order-utils/test/transaction_hash_test.ts +++ b/packages/order-utils/test/transaction_hash_test.ts @@ -14,7 +14,7 @@ const expect = chai.expect; describe('0x transaction hashing', () => { describe('#getTransactionHashHex', () => { - const expectedTransactionHash = '0x420b19f08d5b09c012f381f4bf80a97740b8629f2bac7f42dd7f6aefbb24f3c0'; + const expectedTransactionHash = '0x7845d260300acfbebaff52f0462f984016473290b9eb865fb6ffac0503cab364'; const fakeVerifyingContractAddress = '0x5e72914535f202659083db3a02c984188fa26e9f'; const fakeChainId = 1337; const transaction: ZeroExTransaction = { @@ -24,7 +24,7 @@ describe('0x transaction hashing', () => { gasPrice: new BigNumber(0), data: constants.NULL_BYTES, domain: { - verifyingContractAddress: fakeVerifyingContractAddress, + verifyingContract: fakeVerifyingContractAddress, chainId: fakeChainId, }, }; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 52235c8679..22ad940e3f 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -807,7 +807,7 @@ export interface EIP712DomainWithDefaultSchema { name?: string; version?: string; chainId: number; - verifyingContractAddress: string; + verifyingContract: string; } export enum OrderStatus { diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index d1df23228a..e2fe2ca5af 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -46,7 +46,7 @@ export const signTypedDataUtils = { { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, - { name: 'verifyingContractAddress', type: 'address' }, + { name: 'verifyingContract', type: 'address' }, ], }, ); diff --git a/packages/utils/test/sign_typed_data_utils_test.ts b/packages/utils/test/sign_typed_data_utils_test.ts index f6e2c945c2..9a3c5b01a2 100644 --- a/packages/utils/test/sign_typed_data_utils_test.ts +++ b/packages/utils/test/sign_typed_data_utils_test.ts @@ -36,7 +36,7 @@ describe('signTypedDataUtils', () => { }, primaryType: 'Test', }; - const orderSignTypedDataHashHex = '0xc59d01479d63bda79d1c7fefc883a81ff247f9a1f9168c748922cd7e0dcd5eca'; + const orderSignTypedDataHashHex = '0x78772b297e1b0b31089589a6608930cceba855af9d3ccf7b92cf47fa881e21f7'; const orderSignTypedData = { types: { EIP712Domain: [ @@ -53,7 +53,7 @@ describe('signTypedDataUtils', () => { type: 'uint256', }, { - name: 'verifyingContractAddress', + name: 'verifyingContract', type: 'address', }, ], @@ -112,7 +112,7 @@ describe('signTypedDataUtils', () => { name: '0x Protocol', version: '2', chainId: 1337, - verifyingContractAddress: '0x0000000000000000000000000000000000000000', + verifyingContract: '0x0000000000000000000000000000000000000000', }, message: { makerAddress: '0x0000000000000000000000000000000000000000', @@ -160,7 +160,7 @@ describe('signTypedDataUtils', () => { }; const hash = signTypedDataUtils.generateTypedDataHash(uninitializedOrder).toString('hex'); const hashHex = `0x${hash}`; - expect(hashHex).to.be.eq('0x7624dcf06a5ba0e2799a87adba76a13c7d6418214d6b3c9bc239fdf2422f2027'); + expect(hashHex).to.be.eq('0x510449a190415c4770080d857a1c654b653a0c054c94a7a8e9f08f623f9e824f'); }); }); });