aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-22 16:39:07 +0800
committerFabio Berger <me@fabioberger.com>2018-06-22 16:39:07 +0800
commit3ce295a2af17feef6cd4e3140196501805493719 (patch)
tree964df912ce86d98a211f81f3d6159d797a37c3b3 /packages/contracts/src/utils
parenta30107ab867964d371b2d5fc6791c7b1963f1c7b (diff)
parent0515c6acded983bba05320895ea2c2891f37055c (diff)
downloaddexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar
dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.gz
dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.bz2
dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.lz
dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.xz
dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.zst
dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.zip
Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (40 commits) Use make-promises-safe as a preloader instead of manually importing Updated compiler runs to be 1,000,000 Add event to setSignatureValidatorApproval, rename signer => signerAddress accross all contracts Add senderAddress to Fill and Cancel logs, add comments to events and types Fix Island component Add missing image assets for Chris and Mel Fix some bugs in sol-cov Remove unreachable PreSigned check Fix linting Buttons look hella disabled now Remove border radius, fix width issue for unlock step Add Chris and Mel to about page fix linter issues only call getLocationByOffset if source if defined Set settleOrder and settleMatchedOrders to private Prevent prettier issue Support mobile friendly onboarding flows Removed MixinSettlement. Moved `settleOrder` into `MixinExchangeCore` and `settleMatchedOrders` into `MixinMatchOrders` Migrations after rebasing Linter ...
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/artifacts.ts4
-rw-r--r--packages/contracts/src/utils/constants.ts5
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts2
-rw-r--r--packages/contracts/src/utils/transaction_factory.ts6
-rw-r--r--packages/contracts/src/utils/types.ts3
5 files changed, 15 insertions, 5 deletions
diff --git a/packages/contracts/src/utils/artifacts.ts b/packages/contracts/src/utils/artifacts.ts
index 7ba467708..4375d87c6 100644
--- a/packages/contracts/src/utils/artifacts.ts
+++ b/packages/contracts/src/utils/artifacts.ts
@@ -17,6 +17,8 @@ import * as TestLibBytes from '../artifacts/TestLibBytes.json';
import * as TestLibMem from '../artifacts/TestLibMem.json';
import * as TestLibs from '../artifacts/TestLibs.json';
import * as TestSignatureValidator from '../artifacts/TestSignatureValidator.json';
+import * as TestValidator from '../artifacts/TestValidator.json';
+import * as TestWallet from '../artifacts/TestWallet.json';
import * as TokenRegistry from '../artifacts/TokenRegistry.json';
import * as EtherToken from '../artifacts/WETH9.json';
import * as Whitelist from '../artifacts/Whitelist.json';
@@ -41,6 +43,8 @@ export const artifacts = {
TestLibMem: (TestLibMem as any) as ContractArtifact,
TestLibs: (TestLibs as any) as ContractArtifact,
TestSignatureValidator: (TestSignatureValidator as any) as ContractArtifact,
+ TestValidator: (TestValidator as any) as ContractArtifact,
+ TestWallet: (TestWallet as any) as ContractArtifact,
TokenRegistry: (TokenRegistry as any) as ContractArtifact,
Whitelist: (Whitelist as any) as ContractArtifact,
ZRX: (ZRX as any) as ContractArtifact,
diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts
index ec3c8fd36..f21b8c7a0 100644
--- a/packages/contracts/src/utils/constants.ts
+++ b/packages/contracts/src/utils/constants.ts
@@ -27,6 +27,11 @@ export const constants = {
LIB_BYTES_GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED',
ERC20_INSUFFICIENT_BALANCE: 'Insufficient balance to complete transfer.',
ERC20_INSUFFICIENT_ALLOWANCE: 'Insufficient allowance to complete transfer.',
+ EXCHANGE_LENGTH_GREATER_THAN_0_REQUIRED: 'LENGTH_GREATER_THAN_0_REQUIRED',
+ EXCHANGE_SIGNATURE_UNSUPPORTED: 'SIGNATURE_UNSUPPORTED',
+ EXCHANGE_SIGNATURE_ILLEGAL: 'SIGNATURE_ILLEGAL',
+ EXCHANGE_LENGTH_0_REQUIRED: 'LENGTH_0_REQUIRED',
+ EXCHANGE_LENGTH_65_REQUIRED: 'LENGTH_65_REQUIRED',
TESTRPC_NETWORK_ID: 50,
// Note(albrow): In practice V8 and most other engines limit the minimum
// interval for setInterval to 10ms. We still set it to 0 here in order to
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index 4cc8f0b89..06eb70644 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -215,7 +215,7 @@ export class ExchangeWrapper {
): Promise<TransactionReceiptWithDecodedLogs> {
const txHash = await this._exchange.executeTransaction.sendTransactionAsync(
signedTx.salt,
- signedTx.signer,
+ signedTx.signerAddress,
signedTx.data,
signedTx.signature,
{ from },
diff --git a/packages/contracts/src/utils/transaction_factory.ts b/packages/contracts/src/utils/transaction_factory.ts
index 19ef4e1bf..348c0715d 100644
--- a/packages/contracts/src/utils/transaction_factory.ts
+++ b/packages/contracts/src/utils/transaction_factory.ts
@@ -9,7 +9,7 @@ const EIP712_ZEROEX_TRANSACTION_SCHEMA: EIP712Schema = {
name: 'ZeroExTransaction',
parameters: [
{ name: 'salt', type: EIP712Types.Uint256 },
- { name: 'signer', type: EIP712Types.Address },
+ { name: 'signerAddress', type: EIP712Types.Address },
{ name: 'data', type: EIP712Types.Bytes },
],
};
@@ -25,10 +25,10 @@ export class TransactionFactory {
}
public newSignedTransaction(data: string, signatureType: SignatureType = SignatureType.EthSign): SignedTransaction {
const salt = generatePseudoRandomSalt();
- const signer = `0x${this._signerBuff.toString('hex')}`;
+ const signerAddress = `0x${this._signerBuff.toString('hex')}`;
const executeTransactionData = {
salt,
- signer,
+ signerAddress,
data,
};
const executeTransactionHashBuff = EIP712Utils.structHash(
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index db590213c..24183b549 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -100,6 +100,7 @@ export enum ContractName {
DummyERC721Receiver = 'DummyERC721Receiver',
DummyERC721Token = 'DummyERC721Token',
TestLibBytes = 'TestLibBytes',
+ TestWallet = 'TestWallet',
Authorizable = 'Authorizable',
Whitelist = 'Whitelist',
}
@@ -107,7 +108,7 @@ export enum ContractName {
export interface SignedTransaction {
exchangeAddress: string;
salt: BigNumber;
- signer: string;
+ signerAddress: string;
data: string;
signature: string;
}