All Projects β†’ carver β†’ ethtoken.py

carver / ethtoken.py

Licence: other
Ethereum ERC20 Token Interface, in Python

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to ethtoken.py

ethereum-crowdsale
0xcert protocol crowdsale contracts for Ethereum blockchain.
Stars: ✭ 15 (-62.5%)
Mutual labels:  tokens, ico, erc20
erc20-balance
πŸ’Ž Get 2000+ ERC-20 token balances with JavaScript. Supports Node.js and Deno
Stars: ✭ 18 (-55%)
Mutual labels:  tokens, erc20, erc20-tokens
awesome-ico-truths
Awesome Initial Coin Offerings (ICO) Truths - The Art of the Steal - The Scammers' Big Lies ++ ICO tokens are like bitcoins, ICOs are like IPOs, ICO White Papers are like "Due Diligence" Inverstor Prospectus, ...
Stars: ✭ 32 (-20%)
Mutual labels:  tokens, ico, erc20
Awesome Blockchain Kor
<λΈ”λ‘μ²΄μΈμ˜ 정석>, <ν•˜μ΄νΌλ ˆμ € 블둝체인 개발> μ†ŒμŠ€μ½”λ“œ 및 참고자료 μ €μž₯μ†Œ
Stars: ✭ 243 (+507.5%)
Mutual labels:  ico, erc20
cindicator tokensale
Contracts for Cindicator ICO
Stars: ✭ 14 (-65%)
Mutual labels:  ico, erc20
Awesome Crowdsales
A curated list of ICO repositories that produced ERC20/ERC223 tokens
Stars: ✭ 113 (+182.5%)
Mutual labels:  ico, erc20
ethereum-kit-ios
Comprehensive EVM SDK (ex: Ethereum, Binance Smart Chain) for iOS, implemented on Swift. Create wallets, watch wallets (read-only), sync transactions, filter transactions by type (erc20, bep20, swap transactions etc.), swap using native DEX protocols, easily extendable to work with custom smart contracts, and full support for EIP1159.
Stars: ✭ 148 (+270%)
Mutual labels:  erc20, erc20-tokens
ethereum-erc20
Fungible token implementation for the Ethereum blockchain.
Stars: ✭ 27 (-32.5%)
Mutual labels:  tokens, erc20
zeneth
🏡️ Let Your ETH Chill β€” Gasless Ethereum account abstraction with Flashbots
Stars: ✭ 112 (+180%)
Mutual labels:  tokens, erc20
BokkyPooBahsTokenTeleportationServiceSmartContract
BokkyPooBah's Token Teleportation Service Smart Contract
Stars: ✭ 73 (+82.5%)
Mutual labels:  tokens, erc20
Tokens
Tokens, Tokens, Tokens
Stars: ✭ 101 (+152.5%)
Mutual labels:  tokens, erc20
Cryptocurrency Icons
A set of icons for all the main cryptocurrencies and altcoins, in a range of styles and sizes.
Stars: ✭ 2,116 (+5190%)
Mutual labels:  erc20, erc20-tokens
ETH-transactions-storage
Indexer for Ethereum to get transaction list by ETH address
Stars: ✭ 155 (+287.5%)
Mutual labels:  erc20, erc20-tokens
Ico Contracts
Ethereum smart contracts that have been used during successful ICOs
Stars: ✭ 160 (+300%)
Mutual labels:  ico, erc20
desktop
CoinApp is a simple to use minimal Cryptocurrency Wallet for Ethereum, ERC20 Tokens, Bitcoin and Litecoin built for Windows, Mac and Linux.
Stars: ✭ 60 (+50%)
Mutual labels:  erc20, erc20-tokens
Token Lists
πŸ“š The Token Lists specification
Stars: ✭ 208 (+420%)
Mutual labels:  tokens, erc20
starkgate-frontend
Bridge interface allows users to transfer ERC20 tokens from Ethereum to StarkNet and vice versa.
Stars: ✭ 75 (+87.5%)
Mutual labels:  erc20, erc20-tokens
ERC884-reference-implementation
An Interface and Reference Implementation of the ERC-884 DGCL Token.
Stars: ✭ 42 (+5%)
Mutual labels:  erc20, erc20-tokens
token-allowance-checker
Control ERC20 token approvals
Stars: ✭ 72 (+80%)
Mutual labels:  tokens, erc20
Web3 By Example
Node.js with Web3 javascript examples for getting basic information (transactions, balances, network stats, and tokens) from the Ethereum blockchain.
Stars: ✭ 156 (+290%)
Mutual labels:  tokens, erc20

ethtoken.py

This is a tiny library leveraging web3.py to make an interface for working with EIP20 tokens on Ethereum. (formerly ERC20)

It is currently in Alpha, with 0 automated tests

Usage

Install

virtualenv -p python3 venv
. venv/bin/activate
pip install --pre ethtoken

Initialize

from ethtoken import token

# Use the ENS name that points to your token contract here:
omg = token("omg.thetoken.eth")

Use standard EIP20 methods

Most EIP20 methods are optional. ethtoken makes no attempt to verify which methods are implemented by a token contract.

Here's an example with all the read functions working:

>>> omg.name()
'OMGToken'

>>> omg.symbol()
'OMG'

>>> omg.decimals()
18

>>> omg.totalSupply()
140245398245132780789239631

# Use the ENS name of the owner address here:
>>> omg.balanceOf('ethereumfoundation.eth')
308744633639977714804

Custom methods

ethtoken has a single custom method not in the EIP20 spec: token_balance.

>>> omg.token_balance("ethereumfoundation.eth")
Decimal('308.744633639977714804')

It returns the balance of an address, with the decimal point shifted according to the decimals() value on the contract. In other words, it is the human-readable number of tokens that the given address owns.

Completely Untested: Transfers

In theory, you could use this to send a token. I haven't even tried it once yet. Just don't use it. If you're going to ignore me, don't blame me if you lose tokens or ether.

This should theoretically transfer 1 giga units from 0x0 to 0xdead. (That's 1 nanotoken, at 18 decimals). Of course, this won't work if you don't control the 0x0 address. (hint: you don't)

from web3 import Web3

>>> omg.transfer(
  '0x000000000000000000000000000000000000dEaD',
  10 ** 9,
  transact={
    'from': '0x0000000000000000000000000000000000000000',
    'gasPrice': Web3.toWei('0.1', 'gwei'),
  },
)

Ownership Disclosure

I own some OmiseGo tokens, because anyone who had some ether during their airdrop got some. I don't have any opinions on the company or token.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].