aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-10 23:08:07 +0800
committerFabio Berger <me@fabioberger.com>2018-05-10 23:08:07 +0800
commitcd5f00ac4d41221c99eb8ce767e63e09a6de6a11 (patch)
tree2b1865b5fa6ef86965ea753c032ffaba48403921 /packages/contracts
parent23c4027c83b9f30fad352615386b988084f8b39f (diff)
parentc64ad1af28ef116e210aafb3ea6ad2138361cd7c (diff)
downloaddexon-sol-tools-cd5f00ac4d41221c99eb8ce767e63e09a6de6a11.tar.gz
dexon-sol-tools-cd5f00ac4d41221c99eb8ce767e63e09a6de6a11.tar.zst
dexon-sol-tools-cd5f00ac4d41221c99eb8ce767e63e09a6de6a11.zip
Merge branch 'development' into breakUp0xjs
* development: (38 commits) Add fallback image support to relayer grid tile Clear relayer grid state when fetching Configure the compiler to generate artifacts with deployedBytecode Implement loading and error state for relayer grid Fallback image for relayer grid tile Change relayer grid tile to link on header Display top tokens from backend Remove overflowZ property from portal Suggestions and fix bad merge Fix typo Only show untracked tokens Make wallet scrollable Add token flow Update The Ocean logo Fix artifacts paths Create an artifacts folder Introduce a var Add removeHexPrefix util method CHeck if ABI exists Improve the readability of the check for should compile ... # Conflicts: # .gitignore # packages/contracts/test/multi_sig_with_time_lock.ts # packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts # packages/contracts/util/artifacts.ts
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/compiler.json33
-rw-r--r--packages/contracts/package.json7
-rw-r--r--packages/contracts/test/multi_sig_with_time_lock.ts2
-rw-r--r--packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts5
-rw-r--r--packages/contracts/util/artifacts.ts24
-rw-r--r--packages/contracts/util/types.ts16
6 files changed, 51 insertions, 36 deletions
diff --git a/packages/contracts/compiler.json b/packages/contracts/compiler.json
new file mode 100644
index 000000000..493d6373d
--- /dev/null
+++ b/packages/contracts/compiler.json
@@ -0,0 +1,33 @@
+{
+ "artifactsDir": "../migrations/artifacts/1.0.0",
+ "contractsDir": "src/contracts",
+ "compilerSettings": {
+ "outputSelection": {
+ "*": {
+ "*": [
+ "abi",
+ "evm.bytecode.object",
+ "evm.bytecode.sourceMap",
+ "evm.deployedBytecode.object",
+ "evm.deployedBytecode.sourceMap"
+ ]
+ }
+ }
+ },
+ "contracts": [
+ "Exchange",
+ "DummyToken",
+ "ZRXToken",
+ "Token",
+ "WETH9",
+ "TokenTransferProxy",
+ "MultiSigWallet",
+ "MultiSigWalletWithTimeLock",
+ "MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress",
+ "MaliciousToken",
+ "TokenRegistry",
+ "Arbitrage",
+ "EtherDelta",
+ "AccountLevels"
+ ]
+}
diff --git a/packages/contracts/package.json b/packages/contracts/package.json
index 6d51d71cb..c47518f17 100644
--- a/packages/contracts/package.json
+++ b/packages/contracts/package.json
@@ -10,13 +10,13 @@
"scripts": {
"build:watch": "tsc -w",
"prebuild": "run-s clean compile copy_artifacts generate_contract_wrappers",
- "copy_artifacts": "copyfiles -u 4 '../migrations/src/artifacts/**/*' ./lib/src/artifacts;",
+ "copy_artifacts": "copyfiles -u 4 '../migrations/artifacts/1.0.0/**/*' ./lib/src/artifacts;",
"build": "tsc",
"test": "run-s build run_mocha",
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
"run_mocha": "mocha 'lib/test/**/*.js' --timeout 100000 --bail --exit",
"compile:comment": "Yarn workspaces do not link binaries correctly so we need to reference them directly https://github.com/yarnpkg/yarn/issues/3846",
- "compile": "node ../deployer/lib/src/cli.js compile --contracts ${npm_package_config_contracts} --contracts-dir src/contracts --artifacts-dir ../migrations/src/artifacts",
+ "compile": "node ../deployer/lib/src/cli.js compile",
"clean": "shx rm -rf ./lib",
"generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
"lint": "tslint --project . 'migrations/**/*.ts' 'test/**/*.ts' 'util/**/*.ts' 'deploy/**/*.ts'",
@@ -26,8 +26,7 @@
"test:circleci": "yarn test:coverage"
},
"config": {
- "abis": "../migrations/src/artifacts/@(DummyToken|TokenTransferProxy|Exchange|TokenRegistry|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TokenRegistry|ZRXToken|Arbitrage|EtherDelta|AccountLevels).json",
- "contracts": "Exchange,DummyToken,ZRXToken,Token,WETH9,TokenTransferProxy,MultiSigWallet,MultiSigWalletWithTimeLock,MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress,MaliciousToken,TokenRegistry,Arbitrage,EtherDelta,AccountLevels"
+ "abis": "../migrations/artifacts/1.0.0/@(DummyToken|TokenTransferProxy|Exchange|TokenRegistry|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TokenRegistry|ZRXToken|Arbitrage|EtherDelta|AccountLevels).json"
},
"repository": {
"type": "git",
diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts
index 0f1e3bd11..cf3893780 100644
--- a/packages/contracts/test/multi_sig_with_time_lock.ts
+++ b/packages/contracts/test/multi_sig_with_time_lock.ts
@@ -17,7 +17,7 @@ import { chaiSetup } from './utils/chai_setup';
import { deployer } from './utils/deployer';
import { provider, web3Wrapper } from './utils/web3_wrapper';
-const MULTI_SIG_ABI = artifacts.MultiSigWalletWithTimeLock.networks[constants.TESTRPC_NETWORK_ID].abi;
+const MULTI_SIG_ABI = artifacts.MultiSigWalletWithTimeLock.compilerOutput.abi;
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
diff --git a/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts b/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts
index 006d7f3c6..3ff5b82ed 100644
--- a/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts
+++ b/packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts
@@ -17,10 +17,9 @@ import { ContractName, SubmissionContractEventArgs, TransactionDataParams } from
import { chaiSetup } from './utils/chai_setup';
import { deployer } from './utils/deployer';
import { provider, web3Wrapper } from './utils/web3_wrapper';
-const PROXY_ABI = artifacts.TokenTransferProxy.networks[constants.TESTRPC_NETWORK_ID].abi;
+const PROXY_ABI = artifacts.TokenTransferProxy.compilerOutput.abi;
const MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI =
- artifacts.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.networks[constants.TESTRPC_NETWORK_ID]
- .abi;
+ artifacts.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.compilerOutput.abi;
chaiSetup.configure();
const expect = chai.expect;
diff --git a/packages/contracts/util/artifacts.ts b/packages/contracts/util/artifacts.ts
index f427c6d9a..d262b8058 100644
--- a/packages/contracts/util/artifacts.ts
+++ b/packages/contracts/util/artifacts.ts
@@ -1,3 +1,5 @@
+import { ContractArtifact } from '@0xproject/deployer';
+
import * as DummyToken from '../src/artifacts/DummyToken.json';
import * as Exchange from '../src/artifacts/Exchange.json';
import * as MaliciousToken from '../src/artifacts/MaliciousToken.json';
@@ -9,17 +11,15 @@ import * as TokenTransferProxy from '../src/artifacts/TokenTransferProxy.json';
import * as EtherToken from '../src/artifacts/WETH9.json';
import * as ZRX from '../src/artifacts/ZRXToken.json';
-import { Artifact } from './types';
-
export const artifacts = {
- ZRX: (ZRX as any) as Artifact,
- DummyToken: (DummyToken as any) as Artifact,
- Token: (Token as any) as Artifact,
- Exchange: (Exchange as any) as Artifact,
- EtherToken: (EtherToken as any) as Artifact,
- TokenRegistry: (TokenRegistry as any) as Artifact,
- MaliciousToken: (MaliciousToken as any) as Artifact,
- TokenTransferProxy: (TokenTransferProxy as any) as Artifact,
- MultiSigWalletWithTimeLock: (MultiSigWalletWithTimeLock as any) as Artifact,
- MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress: (MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress as any) as Artifact,
+ ZRX: (ZRX as any) as ContractArtifact,
+ DummyToken: (DummyToken as any) as ContractArtifact,
+ Token: (Token as any) as ContractArtifact,
+ Exchange: (Exchange as any) as ContractArtifact,
+ EtherToken: (EtherToken as any) as ContractArtifact,
+ TokenRegistry: (TokenRegistry as any) as ContractArtifact,
+ MaliciousToken: (MaliciousToken as any) as ContractArtifact,
+ TokenTransferProxy: (TokenTransferProxy as any) as ContractArtifact,
+ MultiSigWalletWithTimeLock: (MultiSigWalletWithTimeLock as any) as ContractArtifact,
+ MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress: (MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress as any) as ContractArtifact,
};
diff --git a/packages/contracts/util/types.ts b/packages/contracts/util/types.ts
index 321084c42..9bc412433 100644
--- a/packages/contracts/util/types.ts
+++ b/packages/contracts/util/types.ts
@@ -100,19 +100,3 @@ export enum ContractName {
EtherDelta = 'EtherDelta',
Arbitrage = 'Arbitrage',
}
-
-export interface Artifact {
- contract_name: ContractName;
- networks: {
- [networkId: number]: {
- abi: ContractAbi;
- solc_version: string;
- keccak256: string;
- optimizer_enabled: number;
- unlinked_binary: string;
- updated_at: number;
- address: string;
- constructor_args: string;
- };
- };
-}