aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/current/test/DummyToken/DummyToken.sol
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-06 05:16:46 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-06 05:16:46 +0800
commit99b1f81e89e3ac929c7829552ea7ae19998524e9 (patch)
tree534161a9fa8bcf8bb5572d7ef0aa311fe9b9d116 /packages/contracts/src/current/test/DummyToken/DummyToken.sol
parent6577d607332e2fb1a442d663e260ecb969457c36 (diff)
parent46ad7b1b38df0f302821258629ffa749e7dd00b9 (diff)
downloaddexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.gz
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.bz2
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.lz
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.xz
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.zst
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.zip
Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development: (37 commits) Add dates to CHANGELOGs Change CHANGELOGs Add .editorconfig Fix a typo Temp Use forEach instead of map Add PR number Fix an exception when a signature collision happens Fix prettier Add regression tests Improve the comment and fix an exception Add missing comas Lerna-ignore tslint and tsconfig Update contract versions, fix tests Rename directories Rename previous contracts, fix imports, add nested file structure Move all contracts into a single directory Update import Fix import Get rid of suffixed contract versioning and replace it with a poor-mans package manager. Versions are stored locally, and are generated in a copy-on-write basis as required ...
Diffstat (limited to 'packages/contracts/src/current/test/DummyToken/DummyToken.sol')
-rw-r--r--packages/contracts/src/current/test/DummyToken/DummyToken.sol37
1 files changed, 37 insertions, 0 deletions
diff --git a/packages/contracts/src/current/test/DummyToken/DummyToken.sol b/packages/contracts/src/current/test/DummyToken/DummyToken.sol
new file mode 100644
index 000000000..ab04f4d16
--- /dev/null
+++ b/packages/contracts/src/current/test/DummyToken/DummyToken.sol
@@ -0,0 +1,37 @@
+pragma solidity ^0.4.18;
+
+import { Mintable } from "../Mintable/Mintable.sol";
+import { Ownable } from "../../utils/Ownable/Ownable.sol";
+
+contract DummyToken is Mintable, Ownable {
+ string public name;
+ string public symbol;
+ uint public decimals;
+
+ function DummyToken(
+ string _name,
+ string _symbol,
+ uint _decimals,
+ uint _totalSupply)
+ public
+ {
+ name = _name;
+ symbol = _symbol;
+ decimals = _decimals;
+ totalSupply = _totalSupply;
+ balances[msg.sender] = _totalSupply;
+ }
+
+ function setBalance(address _target, uint _value)
+ public
+ onlyOwner
+ {
+ uint currBalance = balanceOf(_target);
+ if (_value < currBalance) {
+ totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));
+ } else {
+ totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));
+ }
+ balances[_target] = _value;
+ }
+}