diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-05-09 02:04:31 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-05-09 02:04:31 +0800 |
commit | 607d738342a839788b59e0dee63849ea447331bc (patch) | |
tree | d90078ec0e95357a2fe9fb4af65f9135e9e44408 /packages/contracts | |
parent | b8c611de2b82657a274c55007ffc5d72807eae7f (diff) | |
parent | e9d70b7b1edb5089a6e5e2a9ee8c964ab4b4d4ab (diff) | |
download | dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.gz dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.bz2 dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.lz dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.xz dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.zst dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.zip |
Merge branch 'development' into feature/website/top-bar-redesign
* development: (63 commits)
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
Use named constants
Add a comment
Fix comments
Rename args to constructor-args
Fix a typo
Define a separator const
Move artifacts from src/artifacts to artifacts/v1
Fix sol-cov to work with the new artifacts format
Implement new artifacts format
Publish
Updated CHANGELOGS
Make node types a dependency
Fix type errors in CSS properties
...
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/compiler.json | 33 | ||||
-rw-r--r-- | packages/contracts/package.json | 25 | ||||
-rw-r--r-- | packages/contracts/test/multi_sig_with_time_lock.ts | 2 | ||||
-rw-r--r-- | packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts | 5 | ||||
-rw-r--r-- | packages/contracts/util/artifacts.ts | 24 | ||||
-rw-r--r-- | packages/contracts/util/types.ts | 16 |
6 files changed, 60 insertions, 45 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 30867476f..c47518f17 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "contracts", - "version": "2.1.25", + "version": "2.1.28", "description": "Smart contract components of 0x protocol", "main": "index.js", "directories": { @@ -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", @@ -40,8 +39,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.3.6", - "@0xproject/tslint-config": "^0.4.16", + "@0xproject/dev-utils": "^0.4.1", + "@0xproject/tslint-config": "^0.4.17", "@types/lodash": "4.14.104", "@types/node": "^8.0.53", "@types/yargs": "^10.0.0", @@ -60,12 +59,12 @@ "yargs": "^10.0.3" }, "dependencies": { - "0x.js": "^0.36.3", - "@0xproject/deployer": "^0.4.1", - "@0xproject/types": "^0.6.1", - "@0xproject/typescript-typings": "^0.2.0", - "@0xproject/utils": "^0.5.2", - "@0xproject/web3-wrapper": "^0.6.1", + "0x.js": "^0.37.2", + "@0xproject/deployer": "^0.4.3", + "@0xproject/types": "^0.6.3", + "@0xproject/typescript-typings": "^0.3.1", + "@0xproject/utils": "^0.6.1", + "@0xproject/web3-wrapper": "^0.6.3", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^5.1.1", diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index b7604457f..5cc744713 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.MultiSigWalletWithTimeLockArtifact.networks[constants.TESTRPC_NETWORK_ID].abi; +const MULTI_SIG_ABI = artifacts.MultiSigWalletWithTimeLockArtifact.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 2f928ede2..06fa30d96 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.TokenTransferProxyArtifact.networks[constants.TESTRPC_NETWORK_ID].abi; +const PROXY_ABI = artifacts.TokenTransferProxyArtifact.compilerOutput.abi; const MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI = - artifacts.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact.networks[constants.TESTRPC_NETWORK_ID] - .abi; + artifacts.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact.compilerOutput.abi; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/contracts/util/artifacts.ts b/packages/contracts/util/artifacts.ts index 7c375c1b7..a1d6e5060 100644 --- a/packages/contracts/util/artifacts.ts +++ b/packages/contracts/util/artifacts.ts @@ -1,3 +1,5 @@ +import { ContractArtifact } from '@0xproject/deployer'; + import * as DummyTokenArtifact from '../src/artifacts/DummyToken.json'; import * as ExchangeArtifact from '../src/artifacts/Exchange.json'; import * as MaliciousTokenArtifact from '../src/artifacts/MaliciousToken.json'; @@ -9,17 +11,15 @@ import * as TokenTransferProxyArtifact from '../src/artifacts/TokenTransferProxy import * as EtherTokenArtifact from '../src/artifacts/WETH9.json'; import * as ZRXArtifact from '../src/artifacts/ZRXToken.json'; -import { Artifact } from './types'; - export const artifacts = { - ZRXArtifact: (ZRXArtifact as any) as Artifact, - DummyTokenArtifact: (DummyTokenArtifact as any) as Artifact, - TokenArtifact: (TokenArtifact as any) as Artifact, - ExchangeArtifact: (ExchangeArtifact as any) as Artifact, - EtherTokenArtifact: (EtherTokenArtifact as any) as Artifact, - TokenRegistryArtifact: (TokenRegistryArtifact as any) as Artifact, - MaliciousTokenArtifact: (MaliciousTokenArtifact as any) as Artifact, - TokenTransferProxyArtifact: (TokenTransferProxyArtifact as any) as Artifact, - MultiSigWalletWithTimeLockArtifact: (MultiSigWalletWithTimeLockArtifact as any) as Artifact, - MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact: (MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact as any) as Artifact, + ZRXArtifact: (ZRXArtifact as any) as ContractArtifact, + DummyTokenArtifact: (DummyTokenArtifact as any) as ContractArtifact, + TokenArtifact: (TokenArtifact as any) as ContractArtifact, + ExchangeArtifact: (ExchangeArtifact as any) as ContractArtifact, + EtherTokenArtifact: (EtherTokenArtifact as any) as ContractArtifact, + TokenRegistryArtifact: (TokenRegistryArtifact as any) as ContractArtifact, + MaliciousTokenArtifact: (MaliciousTokenArtifact as any) as ContractArtifact, + TokenTransferProxyArtifact: (TokenTransferProxyArtifact as any) as ContractArtifact, + MultiSigWalletWithTimeLockArtifact: (MultiSigWalletWithTimeLockArtifact as any) as ContractArtifact, + MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact: (MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact 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; - }; - }; -} |