aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/current/test/DummyToken/DummyToken.sol
diff options
context:
space:
mode:
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;
+ }
+}