blob: 3e7d5d1a5302647be3a0c3f7a18dbd8a8a5c7ded (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
pragma solidity ^0.4.11;
import "./../tokens/StandardToken.sol";
contract MaliciousToken is StandardToken {
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];
}
}
|