Skip to content

Instantly share code, notes, and snippets.

@iisaint
Last active July 17, 2017 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iisaint/747cff73e42e605f04455dfe32927e43 to your computer and use it in GitHub Desktop.
Save iisaint/747cff73e42e605f04455dfe32927e43 to your computer and use it in GitHub Desktop.
A smart contract for flooding Taipei Ethereum LogoVote
pragma solidity ^0.4.13;
contract TLV {
function transfer(address to, uint value) returns (bool ok);
}
contract Faucet {
function getToken();
}
contract FloodTLV {
address public owner;
address public tlvAddress;
TLV tlv;
address public faucetAddress;
Faucet faucet;
modifier onlyOwner() {
if (msg.sender != owner) throw;
_;
}
function FloodTLV() {
owner = msg.sender;
tlvAddress = 0x795a9bFa0B30b92eFE663cBfbEC1656b6378748E;
tlv = TLV(tlvAddress);
faucetAddress = 0x5041bfBa3DEB602d794F6CF6C3Db50D572912c40;
faucet = Faucet(faucetAddress);
}
function callGetToken(int _num, uint _gas) onlyOwner {
for(int i=0; i < _num; i++) {
faucet.getToken.gas(_gas)();
}
}
function callTransfer(address _to, uint _value) onlyOwner {
tlv.transfer(_to, _value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment