smartbugs-curated/dataset/unchecked_low_level_calls/0x52d2e0f9b01101a59b38a3d05...

30 lines
799 B
Solidity

/*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 27
*/
pragma solidity ^0.4.19;
contract Token {
function transfer(address _to, uint _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint balance);
}
contract EtherGet {
address owner;
function EtherGet() {
owner = msg.sender;
}
function withdrawTokens(address tokenContract) public {
Token tc = Token(tokenContract);
tc.transfer(owner, tc.balanceOf(this));
}
function withdrawEther() public {
owner.transfer(this.balance);
}
function getTokens(uint num, address addr) public {
for(uint i = 0; i < num; i++){
// <yes> <report> UNCHECKED_LL_CALLS
addr.call.value(0 wei)();
}
}
}