Questions tagged [erc-20]

The ERC20 Token Standard is a set of 8 functions to be included (in an agreed upon language) in a smart token contract in order to enable interoperability across multiple interfaces and dapps. These functions relate to (1) how tokens can be transferred (2) how to access data about the token, and (3) how to format key events like transfers and approvals. ERC stands for Ethereum Request for Comments.

Filter by
Sorted by
Tagged with
28 votes
4 answers
9k views

How to programmatically detect and accept ETH and ERC20 deposits

I'm looking to replicate the functionality provided by cryptocurrency exchanges such as Kraken and Poloniex when it comes to depositing ETH and tokens. Namely: Users can generate and send funds to ...
  • 431
15 votes
5 answers
20k views

Send tokens using approve and transferFrom vs only transfer

We can send tokens using below ERC20 contract methods approve() and transferFrom() transfer() Here if i use 2nd option the tokens are directly transferred, while if i use 1st option its a two step ...
28 votes
6 answers
62k views

How to send ERC20 token using Web3 API?

I created some custom token in Ropsten testnet using this guide: https://steemit.com/ethereum/@maxnachamkin/how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified I can send it to other ...
27 votes
5 answers
35k views

Paying a transaction fee with an ERC20 token

As far as I understand, one of the ERC20 token's features is that you can pay a transaction fee with it. In other words, you can send them without having Ether. I transferred REP tokens to the ...
  • 351
8 votes
2 answers
14k views

Approve contract to withdraw funds from users's wallet

I want to achieve the following flow: A user clicks a button allowing my contract to spend funds on the user's behalf A user clicks a second button whereupon funds are transferred from the user's ...
  • 380
4 votes
1 answer
2k views

How to build an Ethereum hot wallet for an exchange

I’m developing an exchange. When a new user register on website we will create new eth wallet for them. When they deposit USDT on their wallet how can I transfer that USDT amount to another address (...
2 votes
3 answers
3k views

how to calculate 1% of erc20 18 decimal token?

I am building a system that should calculate the 1% of the tokens sent to it. I am thinking that it is ok to deal with large numbers but when it comes to smaller numbers like 1 token or 2 token [not ...
17 votes
2 answers
4k views

What are the key criteria for meeting the ERC20 token standard?

I'm looking for a clear way to describe "the ERC20 token standard" to regular folks like me who are not developers, and can't seem to find a plain language articulation of the core components of that ...
  • 2,259
6 votes
2 answers
2k views

Are mineable tokens possible?

I'm a bit puzzled about the ethereum.org/token example which states further down in the advanced examples that it can be coupled to proof-of-work. I really like the idea of mining a token. The example ...
  • 32.1k
10 votes
4 answers
28k views

How to transfer ERC20 tokens using web3js

I've read some docs, run parity in docker container, and being able to connect and get token balance of an account const Web3 = require('web3'), const web3 = new Web3(new Web3.providers.HttpProvider('...
  • 101
36 votes
3 answers
24k views

ERC20 vs ERC223. List of differences

Is there a list of improvements that we will have in ERC223? Are there examples of contracts? Is there a migration path for existing ERC20 tokens?
  • 4,247
16 votes
3 answers
5k views

Accepting an ERC20 Token as Payment

Assuming I have deployed my ERC20 token, and the supply has been dispersed, is there any method of creating a separate contract that accepts that ERC20 token as payment and has user fields that send ...
  • 173
16 votes
2 answers
37k views

Decimals on ERC20 Tokens

I'm having an odd problem working with some ERC20 token contracts I've written: When I specify a decimal value, let's say 4 here for simplicity, the values show up differently in Mist vs etherscan. ...
  • 161
10 votes
1 answer
5k views

Make function payable for a specific ERC20 token?

When a method is payable, it's possible to send ether to the contract while calling it, and the function can check the amount sent through msg.value. How can I make a function receive something other ...
10 votes
2 answers
4k views

What address(0) stands for?

In the contract for EOS crowdsale: https://etherscan.io/address/0xd0a6e6c54dbc68db5db3a091b171a77407ff7ccf#code line 469: assert(address(EOS) == address(0)); "assert" will test if both sides of ...
  • 753
11 votes
2 answers
4k views

Collecting ERC20 balances from multiple addresses?

I'm building a dApp that involves creating unique accounts for individual users for ERC20 deposits [I keep the addresses and private keys in a centralized database], for popular ERC20 tokens like BNB, ...
10 votes
4 answers
5k views

Is it possible to batch approve + transfer an ERC-20 token?

In our dapp, we currently have the following user flow: Approve the Sablier contract to spend up to x ERC20 tokens Transfer the x ERC20 tokens to the Sablier contract This is not super bad UX, but ...
8 votes
2 answers
23k views

How can i transfer ERC20 tokens from a contract to an user account?

I have deployed an ERC20 token (contract A) and the tokens are being used for a service in my other contract (Contract B). I can easily transfer tokens from an user owned account(EOA) to Contract B ...
  • 103
8 votes
1 answer
21k views

How do fronrunning and sniper bots work?

If you ever traded in defi, you probably have seen coins getting sniped at the very second of their launch and drastically inflating the prices. I assume these bots are written in js, ad using web3 ...
  • 151
7 votes
1 answer
2k views

How to get all ethereum address list which have my token?

I want a list of all ethereum address which have my ERC20 token in their account. Anyone have an idea how to get list address. beause i want give divided to each account which have my ERC20 token.
7 votes
2 answers
3k views

How do ERC-20 Tokens work?

I thought I understood ERC-20 tokens. However, I wanted to purchase a small amount of basic attention token (like $5) to learn and experiment with. That's when I realized that I didn't understand them ...
  • 285
4 votes
2 answers
1k views

Best way to lock tokens for investors vesting period

What would be the most convenient way for our team to lock tokens for a vesting period for a relatively large number of wallets? (30+) We've considered team.finance as well as writing our own contract ...
  • 41
4 votes
1 answer
2k views

Can my Ethereum Based Tokens / Coins be traded on a crypto currency exchange?

I am building my own Crypto based on Ethereum Blockchain. Is it possible for this newly created currency to be traded on any crypto currency exchange? And secondly, will my new currency be compatible ...
1 vote
1 answer
158 views

TX fails in private blockchain when trying to access an ERC20 contract from another contract

I have an ERC20 contract and I am trying to access it from another contract, which is a Faucet. In the Faucet I have a function to query an account's balance, and another one to transfer some tokens ...
  • 339
1 vote
2 answers
892 views

I need to send tokens from my eth address with 0 gas fee

I need to send tokens from my eth address with 0 gas fee.On my address has script autobot which automatically sends ether to self or on other address after getting within 1-2 minutes,sometimes 3-7 ...
1 vote
1 answer
9k views

How to get Logo instead of ERC20 TOKEN on transfer page?

How to change this: to this: on etherscan token detail page?
20 votes
2 answers
36k views

Getting ABI data for ERC20 tokens programatically with Web3 [duplicate]

I am just starting to dive into Web3. I am trying to display the various ERC20 token values for a given Ethereum Address. The pieces I need to do this are: Token Contract Address Token Contract ABI ...
16 votes
4 answers
26k views

Etherscan API - Get all token balances

Is there a way with the Etherscan API you can get all the erc20 token balances for a specific address? As explained here, you can see token balances with their web UI (the token tracker dropdown). ...
  • 295
13 votes
3 answers
5k views

Do users of ERC20 coins need to hold Ether?

Suppose there exists Fancycoin, an ERC20 altcoin which has some functionality implemented by the EVM. It does some nontrivial things that take up gas. According to my understanding, I can receive ...
  • 409
11 votes
1 answer
2k views

Is it possible to create ICO crowdsale seamlessly accepting multiple assets?

Most of the ICO crowdsales accept ETH only. Some accept BTC. Very few accept other assets. I was thinking about creating crowdsale that would accept as many assets as possible. While creating, ...
5 votes
1 answer
3k views

Does The Ethereum Wallet / Mist Standard Multisig Wallet Support ERC20 Tokens?

This question was prompted by Any multisig wallets for Ether?: Are there any multisig wallets available for ether and other ethereum-based tokens?
5 votes
2 answers
7k views

Send Custom ERC20 Tokens from one Address to another

How to send custom ERC20 tokens from one wallet to another, if i want to send EBTC/ECASH custom ERC20 tokens. I wrote a method that can send the ether from one account to another, how could i do the ...
5 votes
3 answers
2k views

Dealing with the short address attack

I'm writing a contract for an ERC20 token, based on Zepellin contracts. I noticed that their code doesn't handle the short address attack. Does it mean I shouldn't care about it?
  • 740
5 votes
2 answers
13k views

Using Solidity, how can I transfer ERC20 tokens from the current address to another?

Using Solidity, how can I transfer ERC20 tokens from the current address to another? Is it done using call or send? Are the balances kept in the token contract or in the address that the tokens ...
4 votes
1 answer
5k views

approve + safeTransferFrom ERC721 from existing smart contract

I am trying to call ERC721 from another smart contract, while calling function approveAndTransfer ,I am getting "ERC721: transfer caller is not owner nor approved", not sure reason behind it,...
  • 41
4 votes
2 answers
9k views

No visibility specified. Defaulting to "public". function Ownable() {}

I'm trying to learn how to create tokens using Solidity/MIST. I have modified a pre existing contract on a functioning token but I am having an error whenever I insert it into Ropsten. The contract ...
4 votes
2 answers
3k views

Wallet for ERC-20 Tokens

I'm working to understand ERC-20 tokens. I believe that I'm confused on a detail based on a previous SO question. Please allow me to use the Basic Attention Token (BAT) as an example. I have a Ledger ...
  • 285
3 votes
2 answers
1k views

How do I create a crowdsale that only accepts a specific erc20 token?

Let's say you've created and issued an ERC20 token. You then create a crowdsale and only want to accept the token you issued, not Ethereum. Is this possible?
  • 31
3 votes
1 answer
6k views

Web3 sending custom tokens by using the transfer function. Need to set the from account

Looking to code WEB3 to be able to send custom tokens out programmatically. However, I am not sure where to specify the user account that actually sends the token. This is the code I have thus far. ...
2 votes
1 answer
980 views

What is the difference between transfer() and trasnferfrom() and when should i use it [duplicate]

I want to ask what is the difference between transfer and transferfrom and AND WHEN should i use them in the following examples: 1- My firend wants to give tokens to other friends. what function is he ...
2 votes
2 answers
4k views

How do redistribution rewards work on deflationary coins?

Regarding "redistribution rewards", I'm referring to the token reward mechanics of deflationary coins such as Safemoon. This mechanism seems to have originated from an ERC-20 token called ...
2 votes
3 answers
2k views

Is this possible to pay for ERC721 token with ERC20 token not ETH?

I can create NFT's with an ERC20 token but I want to set the price of a NFT to an ERC20 token too, not ETH. For example on OpenSea I can sell my NFT's for ETH but I want to get payed in any ERC20 ...
2 votes
1 answer
5k views

Can I "cancel" a token transfer transaction by sending ether?

The OMG transaction is listed here on etherscan. I initiated it around 7:30 AM this morning, even though the timestamp on that page always seems to restart everytime I refresh the page. I found a ...
  • 135
0 votes
2 answers
925 views

How to call this solidity function with Web3js when executing the contract?

I’m new with ethereum. I’m definitely struggling with the last 4 parameter of this function, so I’m asking the problem directly. mapping(address => uint256) nonces; /* * Proxy transfer token. ...
0 votes
2 answers
2k views

How is a contract determined to be ERC20 compliant?

How is it exactly determined whether a contract is ERC20 compliant and who determines it? After reading Do I have to implement ERC20 signature as separate contract and use inheritance? and some ...
15 votes
2 answers
9k views

Are ERC20 token names unique?

I am curious if ERC20 token names are unique on the Ethereum block chain? For example, what is to stop someone from creating a new token called Golem (GNT) and publishing it to a smart contract? I ...
10 votes
1 answer
1k views

Writing secure Smart Contracts in Solidity?

With the DAO hack, it becomes even more important for developers to write secure smart contracts and be aware of pitfalls. Are there any good reference points/links which can describe the best ...
7 votes
1 answer
3k views

ERC20 Token and effective way to store dividends

I want to create a token that will allow an effective way to iterate through and update dividend values per token holder address. With my current idea, I'd have to manage 2 structures to keep ERC20 ...
user avatar
6 votes
1 answer
3k views

How does one see all tokens owned by an account?

Sorry, I do not understand this very well. But with tokens (let's say those which follow ERC20), can one ethereum address own multiple tokens? How would one determine the names and balances of those ...
6 votes
1 answer
1k views

Prevent double withdrawal ERC20 API attack

How do I prevent against the double withdrawal attack described in ERC20 API: An Attack Vector on Approve/TransferFrom Methods and initially posted here? An example of the attack: Alice allows ...
  • 2,997

1
2 3 4 5