Last active
July 17, 2017 23:04
-
-
Save iisaint/747cff73e42e605f04455dfe32927e43 to your computer and use it in GitHub Desktop.
A smart contract for flooding Taipei Ethereum LogoVote
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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