Skip to content

Instantly share code, notes, and snippets.

@banteg
banteg / eos.py
Last active December 5, 2017 11:00
interact with eos token sale contract from python
from web3 import Web3, KeepAliveRPCProvider
web3 = Web3(KeepAliveRPCProvider(host='localhost', port='8545'))
address = '0xd0a6e6c54dbc68db5db3a091b171a77407ff7ccf'
abi = [{'constant': True, 'inputs': [{'name': '', 'type': 'uint256'}, {'name': '', 'type': 'address'}], 'name': 'claimed', 'outputs': [{'name': '', 'type': 'bool'}], 'payable': False, 'type': 'function'}, {'constant': False, 'inputs': [{'name': 'owner_', 'type': 'address'}], 'name': 'setOwner', 'outputs': [], 'payable': False, 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'time', 'outputs': [{'name': '', 'type': 'uint256'}], 'payable': False, 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'totalSupply', 'outputs': [{'name': '', 'type': 'uint128'}], 'payable': False, 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'foundersAllocation', 'outputs': [{'name': '', 'type': 'uint128'}], 'payable': False, 'type': 'function'}, {'constant': False, 'inputs': [{'name': 'day', 'type': 'uint256'}], 'name': 'claim', '