aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0/test
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-07-27 07:30:07 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-08-17 08:31:21 +0800
commitbb3c34589130c6453f4a7ec5a96c75f729b24a67 (patch)
tree72da54e3a4e344c8125c9a9944b81c4d29aa8485 /packages/contracts/src/2.0.0/test
parent0f3201d72a181c3dc7bafba9a82c141f91463ce9 (diff)
downloaddexon-sol-tools-bb3c34589130c6453f4a7ec5a96c75f729b24a67.tar.gz
dexon-sol-tools-bb3c34589130c6453f4a7ec5a96c75f729b24a67.tar.zst
dexon-sol-tools-bb3c34589130c6453f4a7ec5a96c75f729b24a67.zip
Update ERC20Token
Diffstat (limited to 'packages/contracts/src/2.0.0/test')
-rw-r--r--packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol8
-rw-r--r--packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol4
-rw-r--r--packages/contracts/src/2.0.0/test/Mintable/Mintable.sol2
3 files changed, 9 insertions, 5 deletions
diff --git a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol b/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol
index 9272b18a8..20f36db31 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol
+++ b/packages/contracts/src/2.0.0/test/DummyERC20Token/DummyERC20Token.sol
@@ -41,7 +41,7 @@ contract DummyERC20Token is
name = _name;
symbol = _symbol;
decimals = _decimals;
- totalSupply = _totalSupply;
+ _totalSupply = _totalSupply;
balances[msg.sender] = _totalSupply;
}
@@ -49,11 +49,11 @@ contract DummyERC20Token is
public
onlyOwner
{
- uint256 currBalance = balanceOf(_target);
+ uint256 currBalance = balances[_target];
if (_value < currBalance) {
- totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));
+ _totalSupply = safeSub(_totalSupply, safeSub(currBalance, _value));
} else {
- totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));
+ _totalSupply = safeAdd(_totalSupply, safeSub(_value, currBalance));
}
balances[_target] = _value;
}
diff --git a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol b/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
index 5dce74a14..a29ef078f 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
+++ b/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
@@ -32,6 +32,10 @@ contract DummyERC721Receiver is
IERC721Receiver
{
+ // Function selector for ERC721Receiver.onERC721Received
+ // 0x150b7a02
+ bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
+
event TokenReceived(
address from,
uint256 tokenId,
diff --git a/packages/contracts/src/2.0.0/test/Mintable/Mintable.sol b/packages/contracts/src/2.0.0/test/Mintable/Mintable.sol
index 767cc8d25..8e2ecbf40 100644
--- a/packages/contracts/src/2.0.0/test/Mintable/Mintable.sol
+++ b/packages/contracts/src/2.0.0/test/Mintable/Mintable.sol
@@ -38,6 +38,6 @@ contract Mintable is
"Minting more than 100000000000000000000 is not allowed."
);
balances[msg.sender] = safeAdd(_value, balances[msg.sender]);
- totalSupply = safeAdd(totalSupply, _value);
+ _totalSupply = safeAdd(_totalSupply, _value);
}
}