aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/current/test/MaliciousToken/MaliciousToken.sol
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/src/current/test/MaliciousToken/MaliciousToken.sol')
-rw-r--r--packages/contracts/src/current/test/MaliciousToken/MaliciousToken.sol31
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/contracts/src/current/test/MaliciousToken/MaliciousToken.sol b/packages/contracts/src/current/test/MaliciousToken/MaliciousToken.sol
new file mode 100644
index 000000000..9e502616c
--- /dev/null
+++ b/packages/contracts/src/current/test/MaliciousToken/MaliciousToken.sol
@@ -0,0 +1,31 @@
+pragma solidity ^0.4.18;
+
+import { ERC20Token } from "../../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];
+ }
+}