diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-04-22 07:12:39 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-22 08:31:17 +0800 |
commit | 120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab (patch) | |
tree | 32c4ccdd415fabc60e6f5a4fa43007a7e46e727a /packages/contracts/src | |
parent | 1c94ab7cc3819ee991800a3d2439c02e4083a891 (diff) | |
download | dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.tar dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.tar.gz dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.tar.bz2 dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.tar.lz dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.tar.xz dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.tar.zst dexon-sol-tools-120ca5b1ec4c0bbda2cbbf684a4d535c9b3c1bab.zip |
Rename DummyToken => DummyERC20Token
Diffstat (limited to 'packages/contracts/src')
-rw-r--r-- | packages/contracts/src/contracts/current/test/DummyERC20Token/DummyERC20Token.sol (renamed from packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol) | 14 | ||||
-rw-r--r-- | packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol | 49 | ||||
-rw-r--r-- | packages/contracts/src/contracts/current/test/Mintable/Mintable.sol | 2 | ||||
-rw-r--r-- | packages/contracts/src/utils/artifacts.ts | 6 | ||||
-rw-r--r-- | packages/contracts/src/utils/balances.ts | 6 | ||||
-rw-r--r-- | packages/contracts/src/utils/types.ts | 3 |
6 files changed, 14 insertions, 66 deletions
diff --git a/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol b/packages/contracts/src/contracts/current/test/DummyERC20Token/DummyERC20Token.sol index 8b29da919..2626399c2 100644 --- a/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol +++ b/packages/contracts/src/contracts/current/test/DummyERC20Token/DummyERC20Token.sol @@ -21,16 +21,16 @@ pragma solidity ^0.4.21; import "../Mintable/Mintable.sol"; import "../../utils/Ownable/Ownable.sol"; -contract DummyToken is Mintable, Ownable { +contract DummyERC20Token is Mintable, Ownable { string public name; string public symbol; - uint public decimals; + uint256 public decimals; - function DummyToken( + function DummyERC20Token( string _name, string _symbol, - uint _decimals, - uint _totalSupply) + uint256 _decimals, + uint256 _totalSupply) public { name = _name; @@ -40,11 +40,11 @@ contract DummyToken is Mintable, Ownable { balances[msg.sender] = _totalSupply; } - function setBalance(address _target, uint _value) + function setBalance(address _target, uint256 _value) public onlyOwner { - uint currBalance = balanceOf(_target); + uint256 currBalance = balanceOf(_target); if (_value < currBalance) { totalSupply = safeSub(totalSupply, safeSub(currBalance, _value)); } else { diff --git a/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol b/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol deleted file mode 100644 index 3a0092276..000000000 --- a/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol +++ /dev/null @@ -1,49 +0,0 @@ -/* - - Copyright 2018 ZeroEx Intl. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ - -pragma solidity ^0.4.21; - -import "../../tokens/ERC20Token/ERC20Token.sol"; - -contract MaliciousToken is ERC20Token { - uint8 stateToUpdate = 1; // Not null so that change only requires 5000 gas - - function updateState() - internal - { - stateToUpdate++; - } - - function balanceOf(address _owner) - public - constant - returns (uint) - { - updateState(); - return balances[_owner]; - } - - function allowance(address _owner, address _spender) - public - constant - returns (uint) - { - updateState(); - return allowed[_owner][_spender]; - } -} diff --git a/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol b/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol index 81cbd39dd..305737b72 100644 --- a/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol +++ b/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol @@ -26,7 +26,7 @@ import "../../utils/SafeMath/SafeMath.sol"; * Base contract that creates a mintable UnlimitedAllowanceToken */ contract Mintable is UnlimitedAllowanceToken, SafeMath { - function mint(uint _value) + function mint(uint256 _value) public { require(_value <= 100000000000000000000); diff --git a/packages/contracts/src/utils/artifacts.ts b/packages/contracts/src/utils/artifacts.ts index 87cc73cff..db52ef0d8 100644 --- a/packages/contracts/src/utils/artifacts.ts +++ b/packages/contracts/src/utils/artifacts.ts @@ -1,6 +1,5 @@ -import * as DummyTokenArtifact from '../artifacts/DummyToken.json'; +import * as DummyERC20TokenArtifact from '../artifacts/DummyERC20Token.json'; import * as ExchangeArtifact from '../artifacts/Exchange.json'; -import * as MaliciousTokenArtifact from '../artifacts/MaliciousToken.json'; import * as MultiSigWalletWithTimeLockArtifact from '../artifacts/MultiSigWalletWithTimeLock.json'; import * as MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact from '../artifacts/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json'; import * as TokenArtifact from '../artifacts/Token.json'; @@ -12,12 +11,11 @@ import { Artifact } from './types'; export const artifacts = { ZRXArtifact: (ZRXArtifact as any) as Artifact, - DummyTokenArtifact: (DummyTokenArtifact as any) as Artifact, + DummyERC20TokenArtifact: (DummyERC20TokenArtifact 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, MultiSigWalletWithTimeLockArtifact: (MultiSigWalletWithTimeLockArtifact as any) as Artifact, MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact: (MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact as any) as Artifact, }; diff --git a/packages/contracts/src/utils/balances.ts b/packages/contracts/src/utils/balances.ts index 2ebc10313..40a59e815 100644 --- a/packages/contracts/src/utils/balances.ts +++ b/packages/contracts/src/utils/balances.ts @@ -2,14 +2,14 @@ import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import * as Web3 from 'web3'; -import { DummyTokenContract } from '../contract_wrappers/generated/dummy_token'; +import { DummyERC20TokenContract } from '../contract_wrappers/generated/dummy_e_r_c20_token'; import { BalancesByOwner } from './types'; export class Balances { - private _tokenContractInstances: DummyTokenContract[]; + private _tokenContractInstances: DummyERC20TokenContract[]; private _ownerAddresses: string[]; - constructor(tokenContractInstances: DummyTokenContract[], ownerAddresses: string[]) { + constructor(tokenContractInstances: DummyERC20TokenContract[], ownerAddresses: string[]) { this._tokenContractInstances = tokenContractInstances; this._ownerAddresses = ownerAddresses; } diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts index 7de167f27..69792b846 100644 --- a/packages/contracts/src/utils/types.ts +++ b/packages/contracts/src/utils/types.ts @@ -100,10 +100,9 @@ export enum ContractName { MultiSigWalletWithTimeLock = 'MultiSigWalletWithTimeLock', Exchange = 'Exchange', ZRXToken = 'ZRXToken', - DummyToken = 'DummyToken', + DummyERC20Token = 'DummyERC20Token', EtherToken = 'WETH9', MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress = 'MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', - MaliciousToken = 'MaliciousToken', AccountLevels = 'AccountLevels', EtherDelta = 'EtherDelta', Arbitrage = 'Arbitrage', |