diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-02-02 02:21:44 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-02-03 01:39:08 +0800 |
commit | bb4c8bf8eb8c347900980d92534b19a3a80c690b (patch) | |
tree | c9987518adb083fa0617fe0c86a441cfc7bc6054 | |
parent | 3eb40db498ab8e7a0a7dfc9f67299989288b4ea1 (diff) | |
download | dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.tar dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.tar.gz dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.tar.bz2 dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.tar.lz dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.tar.xz dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.tar.zst dexon-sol-tools-bb4c8bf8eb8c347900980d92534b19a3a80c690b.zip |
Rename previous contracts, fix imports, add nested file structure
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | packages/contracts/build/artifacts/DummyToken.json | 0 | ||||
-rw-r--r-- | packages/contracts/build/artifacts/ERC20Token.json | 0 | ||||
-rw-r--r-- | packages/contracts/contracts/current/Exchange/Exchange.sol | 6 | ||||
-rw-r--r-- | packages/contracts/contracts/current/TokenRegistry/TokenRegistry.sol | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/current/TokenTransferProxy/TokenTransferProxy.sol | 4 | ||||
-rw-r--r-- | packages/contracts/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol (renamed from packages/contracts/contracts/current/MultiSigWallet/MultiSigWallet.sol) | 0 | ||||
-rw-r--r-- | packages/contracts/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol (renamed from packages/contracts/contracts/current/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol (renamed from packages/contracts/contracts/current/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/current/test/DummyToken/DummyToken.sol (renamed from packages/contracts/contracts/current/DummyToken/DummyToken.sol) | 6 | ||||
-rw-r--r-- | packages/contracts/contracts/current/test/MaliciousToken/MaliciousToken.sol (renamed from packages/contracts/contracts/current/MaliciousToken/MaliciousToken.sol) | 6 | ||||
-rw-r--r-- | packages/contracts/contracts/current/test/Mintable/Mintable.sol (renamed from packages/contracts/contracts/current/Mintable/Mintable.sol) | 6 | ||||
-rw-r--r-- | packages/contracts/contracts/current/tokens/ERC20Token/ERC20Token.sol (renamed from packages/contracts/contracts/current/ERC20Token/ERC20Token.sol) | 4 | ||||
-rw-r--r-- | packages/contracts/contracts/current/tokens/Token/Token.sol (renamed from packages/contracts/contracts/current/Token/Token.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol (renamed from packages/contracts/contracts/current/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol) | 4 | ||||
-rw-r--r-- | packages/contracts/contracts/current/tokens/WETH9/WETH9.sol (renamed from packages/contracts/contracts/current/WETH9/WETH9.sol) | 0 | ||||
-rw-r--r-- | packages/contracts/contracts/current/tokens/ZRXToken/ZRXToken.sol (renamed from packages/contracts/contracts/current/ZRXToken/ZRXToken.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/current/utils/Ownable/Ownable.sol (renamed from packages/contracts/contracts/current/Ownable/Ownable.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/current/utils/SafeMath/SafeMath.sol (renamed from packages/contracts/contracts/current/SafeMath/SafeMath.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/previous/ERC20Token/ERC20Token_v1.sol (renamed from packages/contracts/contracts/current/StandardToken/StandardToken.sol) | 4 | ||||
-rw-r--r-- | packages/contracts/contracts/previous/Ownable/Ownable_v1.sol (renamed from packages/contracts/contracts/old/Ownable/v1.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/previous/SafeMath/SafeMath_v1.sol (renamed from packages/contracts/contracts/old/SafeMath/v1.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/previous/Token/Token_v1.sol (renamed from packages/contracts/contracts/old/Token/v1.sol) | 2 | ||||
-rw-r--r-- | packages/contracts/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol (renamed from packages/contracts/contracts/old/UnlimitedAllowanceToken/v1.sol) | 4 | ||||
-rw-r--r-- | packages/contracts/util/artifacts.ts | 1 | ||||
-rw-r--r-- | packages/deployer/src/compiler.ts | 1 |
26 files changed, 35 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore index 24b8d044f..cbaa5b67e 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ packages/website/public/bundle* # generated binaries bin/ + +# contract artifacts +packages/contracts/build/ diff --git a/packages/contracts/build/artifacts/DummyToken.json b/packages/contracts/build/artifacts/DummyToken.json deleted file mode 100644 index e69de29bb..000000000 --- a/packages/contracts/build/artifacts/DummyToken.json +++ /dev/null diff --git a/packages/contracts/build/artifacts/ERC20Token.json b/packages/contracts/build/artifacts/ERC20Token.json deleted file mode 100644 index e69de29bb..000000000 --- a/packages/contracts/build/artifacts/ERC20Token.json +++ /dev/null diff --git a/packages/contracts/contracts/current/Exchange/Exchange.sol b/packages/contracts/contracts/current/Exchange/Exchange.sol index 690c9820f..c0bbff2cd 100644 --- a/packages/contracts/contracts/current/Exchange/Exchange.sol +++ b/packages/contracts/contracts/current/Exchange/Exchange.sol @@ -18,9 +18,9 @@ pragma solidity ^0.4.11; -import "../TokenTransferProxy/TokenTransferProxy.sol"; -import "../../old/Token/v1.sol"; -import "../../old/SafeMath/v1.sol"; +import { TokenTransferProxy } from "../TokenTransferProxy/TokenTransferProxy.sol"; +import { Token_v1 as Token } from "../../previous/Token/Token_v1.sol"; +import { SafeMath_v1 as SafeMath } from "../../previous/SafeMath/SafeMath_v1.sol"; /// @title Exchange - Facilitates exchange of ERC20 tokens. /// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com> diff --git a/packages/contracts/contracts/current/TokenRegistry/TokenRegistry.sol b/packages/contracts/contracts/current/TokenRegistry/TokenRegistry.sol index 29b42c0ef..ea7a5ff1b 100644 --- a/packages/contracts/contracts/current/TokenRegistry/TokenRegistry.sol +++ b/packages/contracts/contracts/current/TokenRegistry/TokenRegistry.sol @@ -18,7 +18,7 @@ pragma solidity ^0.4.11; -import "../../old/Ownable/v1.sol"; +import { Ownable_v1 as Ownable } from "../../previous/Ownable/Ownable_v1.sol"; /// @title Token Registry - Stores metadata associated with ERC20 tokens. See ERC22 https://github.com/ethereum/EIPs/issues/22 /// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com> diff --git a/packages/contracts/contracts/current/TokenTransferProxy/TokenTransferProxy.sol b/packages/contracts/contracts/current/TokenTransferProxy/TokenTransferProxy.sol index 62adfaa8e..3a1636f37 100644 --- a/packages/contracts/contracts/current/TokenTransferProxy/TokenTransferProxy.sol +++ b/packages/contracts/contracts/current/TokenTransferProxy/TokenTransferProxy.sol @@ -18,8 +18,8 @@ pragma solidity ^0.4.11; -import "../../old/Token/v1.sol"; -import "../../old/Ownable/v1.sol"; +import { Token_v1 as Token } from "../../previous/Token/Token_v1.sol"; +import { Ownable_v1 as Ownable } from "../../previous/Ownable/Ownable_v1.sol"; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com> diff --git a/packages/contracts/contracts/current/MultiSigWallet/MultiSigWallet.sol b/packages/contracts/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol index ae7ef06fd..ae7ef06fd 100644 --- a/packages/contracts/contracts/current/MultiSigWallet/MultiSigWallet.sol +++ b/packages/contracts/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol diff --git a/packages/contracts/contracts/current/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol b/packages/contracts/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol index f8606762e..46c152035 100644 --- a/packages/contracts/contracts/current/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol +++ b/packages/contracts/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol @@ -18,7 +18,7 @@ pragma solidity ^0.4.11; -import "../MultiSigWallet/MultiSigWallet.sol"; +import { MultiSigWallet } from "../MultiSigWallet/MultiSigWallet.sol"; /// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed. /// @author Amir Bandeali - <amir@0xProject.com> diff --git a/packages/contracts/contracts/current/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol b/packages/contracts/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol index 81a3d4637..8cc8372c1 100644 --- a/packages/contracts/contracts/current/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol +++ b/packages/contracts/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol @@ -18,7 +18,7 @@ pragma solidity ^0.4.11; -import "../MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol"; +import { MultiSigWalletWithTimeLock } from "../MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol"; contract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWalletWithTimeLock { diff --git a/packages/contracts/contracts/current/DummyToken/DummyToken.sol b/packages/contracts/contracts/current/test/DummyToken/DummyToken.sol index 67d6a818d..ab04f4d16 100644 --- a/packages/contracts/contracts/current/DummyToken/DummyToken.sol +++ b/packages/contracts/contracts/current/test/DummyToken/DummyToken.sol @@ -1,7 +1,7 @@ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; -import "../Mintable/Mintable.sol"; -import "../Ownable/Ownable.sol"; +import { Mintable } from "../Mintable/Mintable.sol"; +import { Ownable } from "../../utils/Ownable/Ownable.sol"; contract DummyToken is Mintable, Ownable { string public name; diff --git a/packages/contracts/contracts/current/MaliciousToken/MaliciousToken.sol b/packages/contracts/contracts/current/test/MaliciousToken/MaliciousToken.sol index c3cace9af..9e502616c 100644 --- a/packages/contracts/contracts/current/MaliciousToken/MaliciousToken.sol +++ b/packages/contracts/contracts/current/test/MaliciousToken/MaliciousToken.sol @@ -1,8 +1,8 @@ -pragma solidity ^0.4.11; +pragma solidity ^0.4.18; -import "../StandardToken/StandardToken.sol"; +import { ERC20Token } from "../../tokens/ERC20Token/ERC20Token.sol"; -contract MaliciousToken is StandardToken { +contract MaliciousToken is ERC20Token { uint8 stateToUpdate = 1; // Not null so that change only requires 5000 gas function updateState() diff --git a/packages/contracts/contracts/current/Mintable/Mintable.sol b/packages/contracts/contracts/current/test/Mintable/Mintable.sol index 2dbc0f349..cf7ee35a5 100644 --- a/packages/contracts/contracts/current/Mintable/Mintable.sol +++ b/packages/contracts/contracts/current/test/Mintable/Mintable.sol @@ -1,7 +1,7 @@ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; -import "../UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol"; -import "../SafeMath/SafeMath.sol"; +import { UnlimitedAllowanceToken } from "../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol"; +import { SafeMath } from "../../utils/SafeMath/SafeMath.sol"; /* * Mintable diff --git a/packages/contracts/contracts/current/ERC20Token/ERC20Token.sol b/packages/contracts/contracts/current/tokens/ERC20Token/ERC20Token.sol index 976b5564e..0e5b87aa4 100644 --- a/packages/contracts/contracts/current/ERC20Token/ERC20Token.sol +++ b/packages/contracts/contracts/current/tokens/ERC20Token/ERC20Token.sol @@ -1,6 +1,6 @@ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; -import "../Token/Token.sol"; +import { Token } from "../Token/Token.sol"; contract ERC20Token is Token { diff --git a/packages/contracts/contracts/current/Token/Token.sol b/packages/contracts/contracts/current/tokens/Token/Token.sol index 8688bcae8..bf4e71dcd 100644 --- a/packages/contracts/contracts/current/Token/Token.sol +++ b/packages/contracts/contracts/current/tokens/Token/Token.sol @@ -1,4 +1,4 @@ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; contract Token { diff --git a/packages/contracts/contracts/current/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol b/packages/contracts/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol index 52b80f8c8..699f535d2 100644 --- a/packages/contracts/contracts/current/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol +++ b/packages/contracts/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol @@ -16,9 +16,9 @@ */ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; -import "../ERC20Token/ERC20Token.sol"; +import { ERC20Token } from "../ERC20Token/ERC20Token.sol"; contract UnlimitedAllowanceToken is ERC20Token { diff --git a/packages/contracts/contracts/current/WETH9/WETH9.sol b/packages/contracts/contracts/current/tokens/WETH9/WETH9.sol index 733ca414b..733ca414b 100644 --- a/packages/contracts/contracts/current/WETH9/WETH9.sol +++ b/packages/contracts/contracts/current/tokens/WETH9/WETH9.sol diff --git a/packages/contracts/contracts/current/ZRXToken/ZRXToken.sol b/packages/contracts/contracts/current/tokens/ZRXToken/ZRXToken.sol index 7b293da61..7f5e1f849 100644 --- a/packages/contracts/contracts/current/ZRXToken/ZRXToken.sol +++ b/packages/contracts/contracts/current/tokens/ZRXToken/ZRXToken.sol @@ -18,7 +18,7 @@ pragma solidity ^0.4.11; -import "../../old/UnlimitedAllowanceToken/v1.sol"; +import { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from "../../../previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol"; contract ZRXToken is UnlimitedAllowanceToken { diff --git a/packages/contracts/contracts/current/Ownable/Ownable.sol b/packages/contracts/contracts/current/utils/Ownable/Ownable.sol index 199c3c1c1..9b3d6b9cf 100644 --- a/packages/contracts/contracts/current/Ownable/Ownable.sol +++ b/packages/contracts/contracts/current/utils/Ownable/Ownable.sol @@ -1,4 +1,4 @@ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; /* * Ownable diff --git a/packages/contracts/contracts/current/SafeMath/SafeMath.sol b/packages/contracts/contracts/current/utils/SafeMath/SafeMath.sol index 325bddc82..955a9e379 100644 --- a/packages/contracts/contracts/current/SafeMath/SafeMath.sol +++ b/packages/contracts/contracts/current/utils/SafeMath/SafeMath.sol @@ -1,4 +1,4 @@ -pragma solidity 0.4.18; +pragma solidity ^0.4.18; contract SafeMath { function safeMul(uint a, uint b) diff --git a/packages/contracts/contracts/current/StandardToken/StandardToken.sol b/packages/contracts/contracts/previous/ERC20Token/ERC20Token_v1.sol index 9da3fa782..e05ee2d5e 100644 --- a/packages/contracts/contracts/current/StandardToken/StandardToken.sol +++ b/packages/contracts/contracts/previous/ERC20Token/ERC20Token_v1.sol @@ -1,8 +1,8 @@ pragma solidity ^0.4.11; -import "../../old/Token/v1.sol"; +import { Token_v1 as Token } from "../Token/Token_v1.sol"; -contract StandardToken is Token { +contract ERC20Token_v1 is Token { function transfer(address _to, uint _value) returns (bool) { //Default assumes totalSupply can't be over max (2^256 - 1). diff --git a/packages/contracts/contracts/old/Ownable/v1.sol b/packages/contracts/contracts/previous/Ownable/Ownable_v1.sol index 5488896d7..3630678f7 100644 --- a/packages/contracts/contracts/old/Ownable/v1.sol +++ b/packages/contracts/contracts/previous/Ownable/Ownable_v1.sol @@ -7,7 +7,7 @@ pragma solidity ^0.4.11; * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner. */ -contract Ownable { +contract Ownable_v1 { address public owner; function Ownable() { diff --git a/packages/contracts/contracts/old/SafeMath/v1.sol b/packages/contracts/contracts/previous/SafeMath/SafeMath_v1.sol index e35c0dc81..341d611ec 100644 --- a/packages/contracts/contracts/old/SafeMath/v1.sol +++ b/packages/contracts/contracts/previous/SafeMath/SafeMath_v1.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.11; -contract SafeMath { +contract SafeMath_v1 { function safeMul(uint a, uint b) internal constant diff --git a/packages/contracts/contracts/old/Token/v1.sol b/packages/contracts/contracts/previous/Token/Token_v1.sol index 507de9b12..de619fb7e 100644 --- a/packages/contracts/contracts/old/Token/v1.sol +++ b/packages/contracts/contracts/previous/Token/Token_v1.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.11; -contract Token { +contract Token_v1 { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} diff --git a/packages/contracts/contracts/old/UnlimitedAllowanceToken/v1.sol b/packages/contracts/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol index fc794998a..6376f3f2c 100644 --- a/packages/contracts/contracts/old/UnlimitedAllowanceToken/v1.sol +++ b/packages/contracts/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol @@ -18,9 +18,9 @@ pragma solidity ^0.4.11; -import "../../contracts/StandardToken/StandardToken.sol"; +import { ERC20Token_v1 as ERC20Token } from "../ERC20Token/ERC20Token_v1.sol"; -contract UnlimitedAllowanceToken is StandardToken { +contract UnlimitedAllowanceToken_v1 is ERC20Token { uint constant MAX_UINT = 2**256 - 1; diff --git a/packages/contracts/util/artifacts.ts b/packages/contracts/util/artifacts.ts index 145b1db3b..cbe6e24c0 100644 --- a/packages/contracts/util/artifacts.ts +++ b/packages/contracts/util/artifacts.ts @@ -1,5 +1,4 @@ import * as DummyTokenArtifact from '../build/artifacts/DummyToken.json'; -import * as DummyTokenV2Artifact from '../build/artifacts/DummyToken_v2.json'; import * as ExchangeArtifact from '../build/artifacts/Exchange.json'; import * as MaliciousTokenArtifact from '../build/artifacts/MaliciousToken.json'; import * as MultiSigWalletWithTimeLockArtifact from '../build/artifacts/MultiSigWalletWithTimeLock.json'; diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 67c46989a..63db6c865 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -181,7 +181,6 @@ export class Compiler { ); if (!_.isUndefined(compiled.errors)) { - utils.consoleLog(compiled.errors); _.each(compiled.errors, errMsg => { const normalizedErrMsg = Compiler._getNormalizedErrMsg(errMsg); this._solcErrors.add(normalizedErrMsg); |