Rename previous contracts, fix imports, add nested file structure

This commit is contained in:
Amir Bandeali
2018-02-01 10:21:44 -08:00
parent 3eb40db498
commit bb4c8bf8eb
26 changed files with 35 additions and 34 deletions

3
.gitignore vendored
View File

@@ -71,3 +71,6 @@ packages/website/public/bundle*
# generated binaries # generated binaries
bin/ bin/
# contract artifacts
packages/contracts/build/

View File

@@ -18,9 +18,9 @@
pragma solidity ^0.4.11; pragma solidity ^0.4.11;
import "../TokenTransferProxy/TokenTransferProxy.sol"; import { TokenTransferProxy } from "../TokenTransferProxy/TokenTransferProxy.sol";
import "../../old/Token/v1.sol"; import { Token_v1 as Token } from "../../previous/Token/Token_v1.sol";
import "../../old/SafeMath/v1.sol"; import { SafeMath_v1 as SafeMath } from "../../previous/SafeMath/SafeMath_v1.sol";
/// @title Exchange - Facilitates exchange of ERC20 tokens. /// @title Exchange - Facilitates exchange of ERC20 tokens.
/// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com> /// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>

View File

@@ -18,7 +18,7 @@
pragma solidity ^0.4.11; 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 /// @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> /// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>

View File

@@ -18,8 +18,8 @@
pragma solidity ^0.4.11; pragma solidity ^0.4.11;
import "../../old/Token/v1.sol"; import { Token_v1 as Token } from "../../previous/Token/Token_v1.sol";
import "../../old/Ownable/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. /// @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> /// @author Amir Bandeali - <amir@0xProject.com>, Will Warren - <will@0xProject.com>

View File

@@ -18,7 +18,7 @@
pragma solidity ^0.4.11; 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. /// @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> /// @author Amir Bandeali - <amir@0xProject.com>

View File

@@ -18,7 +18,7 @@
pragma solidity ^0.4.11; pragma solidity ^0.4.11;
import "../MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol"; import { MultiSigWalletWithTimeLock } from "../MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol";
contract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWalletWithTimeLock { contract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWalletWithTimeLock {

View File

@@ -1,7 +1,7 @@
pragma solidity 0.4.18; pragma solidity ^0.4.18;
import "../Mintable/Mintable.sol"; import { Mintable } from "../Mintable/Mintable.sol";
import "../Ownable/Ownable.sol"; import { Ownable } from "../../utils/Ownable/Ownable.sol";
contract DummyToken is Mintable, Ownable { contract DummyToken is Mintable, Ownable {
string public name; string public name;

View File

@@ -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 uint8 stateToUpdate = 1; // Not null so that change only requires 5000 gas
function updateState() function updateState()

View File

@@ -1,7 +1,7 @@
pragma solidity 0.4.18; pragma solidity ^0.4.18;
import "../UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol"; import { UnlimitedAllowanceToken } from "../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol";
import "../SafeMath/SafeMath.sol"; import { SafeMath } from "../../utils/SafeMath/SafeMath.sol";
/* /*
* Mintable * Mintable

View File

@@ -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 { contract ERC20Token is Token {

View File

@@ -1,4 +1,4 @@
pragma solidity 0.4.18; pragma solidity ^0.4.18;
contract Token { contract Token {

View File

@@ -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 { contract UnlimitedAllowanceToken is ERC20Token {

View File

@@ -18,7 +18,7 @@
pragma solidity ^0.4.11; 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 { contract ZRXToken is UnlimitedAllowanceToken {

View File

@@ -1,4 +1,4 @@
pragma solidity 0.4.18; pragma solidity ^0.4.18;
/* /*
* Ownable * Ownable

View File

@@ -1,4 +1,4 @@
pragma solidity 0.4.18; pragma solidity ^0.4.18;
contract SafeMath { contract SafeMath {
function safeMul(uint a, uint b) function safeMul(uint a, uint b)

View File

@@ -1,8 +1,8 @@
pragma solidity ^0.4.11; 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) { function transfer(address _to, uint _value) returns (bool) {
//Default assumes totalSupply can't be over max (2^256 - 1). //Default assumes totalSupply can't be over max (2^256 - 1).

View File

@@ -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. * 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; address public owner;
function Ownable() { function Ownable() {

View File

@@ -1,6 +1,6 @@
pragma solidity ^0.4.11; pragma solidity ^0.4.11;
contract SafeMath { contract SafeMath_v1 {
function safeMul(uint a, uint b) function safeMul(uint a, uint b)
internal internal
constant constant

View File

@@ -1,6 +1,6 @@
pragma solidity ^0.4.11; pragma solidity ^0.4.11;
contract Token { contract Token_v1 {
/// @return total amount of tokens /// @return total amount of tokens
function totalSupply() constant returns (uint supply) {} function totalSupply() constant returns (uint supply) {}

View File

@@ -18,9 +18,9 @@
pragma solidity ^0.4.11; 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; uint constant MAX_UINT = 2**256 - 1;

View File

@@ -1,5 +1,4 @@
import * as DummyTokenArtifact from '../build/artifacts/DummyToken.json'; 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 ExchangeArtifact from '../build/artifacts/Exchange.json';
import * as MaliciousTokenArtifact from '../build/artifacts/MaliciousToken.json'; import * as MaliciousTokenArtifact from '../build/artifacts/MaliciousToken.json';
import * as MultiSigWalletWithTimeLockArtifact from '../build/artifacts/MultiSigWalletWithTimeLock.json'; import * as MultiSigWalletWithTimeLockArtifact from '../build/artifacts/MultiSigWalletWithTimeLock.json';

View File

@@ -181,7 +181,6 @@ export class Compiler {
); );
if (!_.isUndefined(compiled.errors)) { if (!_.isUndefined(compiled.errors)) {
utils.consoleLog(compiled.errors);
_.each(compiled.errors, errMsg => { _.each(compiled.errors, errMsg => {
const normalizedErrMsg = Compiler._getNormalizedErrMsg(errMsg); const normalizedErrMsg = Compiler._getNormalizedErrMsg(errMsg);
this._solcErrors.add(normalizedErrMsg); this._solcErrors.add(normalizedErrMsg);