As of May 31, 2023, we have updated our Code of Conduct.

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
0 votes
1 answer
398 views

Minting/Sending 0 Value ERC-20 Tokens in Response to Transaction in Another Contract

I currently have a working ERC-20 contract for a small group that I am in. I would like to make a new contract that mints or sends a 0 value token without liquidity similar to a rewards token that has ...
0 votes
2 answers
817 views

How can I import an existing ERC20 token into my contract?

I'm trying to develop a staking contract. All of the guides I've seen utilize either payable (ETH) or a newly created token. How can I import an existing token (presumably via address) into my ...
0 votes
1 answer
324 views

Batch Transfer ERC20 Tokens From One Wallet To Another Wallet

Is it possible to batch transfer ERC20 tokens from one wallet to another with one transaction call? For example, one wallet has 10 ERC20 tokens. We want to get all the ERC20 token contracts in wallet ...
0 votes
1 answer
519 views

Transfer Ownership of a contract

Someone is making me a dex and a token, and i am not sure if TransferOwnership to my erc20 address it`s enough. Token will be mintable with a mint rate/block of 4 tokens, and initial supply of 1 mil. ...
1 vote
1 answer
650 views

I'm confused about decimals and total Supply with my erc20 token

I created erc20 token. I want total supply of 50,00,000. And I want to give 7% tax on every transaction. So if anyone sends single coin then, how can I get 7% and transfer remaining to receiver? For ...
1 vote
1 answer
515 views

Swapping ERC20 tokens on MyEtherWallet

I just found out about the token swapping function of MyEtherWallet: https://kb.myetherwallet.com/en/swap/swapping-via-kyber-bity-changelly/ Now, let's say I have a lot of ERC20 tokens that I want to ...
1 vote
3 answers
35 views

Can't set up basic token contract

I'm trying to set up a simple token contract and deploy it but i'm having some trouble. This is the token contract pragma solidity ^0.8.0; import "hardhat/console.sol"; contract Token { ...
0 votes
1 answer
2k views

Move ERC20 tokens from Ethereum Wallet Contract to Account

In my Ethereum wallet, I am trying to access my wallet conract. If I sync in light mode and import the wallet contract address it just stays there displayed, greyed out and nothing happens, no matter ...
0 votes
1 answer
278 views

not implement an abstract parent's methods completely or not invoke an inherited contract's constructor correctly

Having This error while deploying. pragma solidity 0.4.25; // ---------------------------------------------------------------------------- // Sample token contract // // Symbol : {{Token ...
1 vote
0 answers
25 views

When I create a presale token how do the inputs? [closed]

I created a pre-sale token and I want to input the total supply, name, symbol and all that. How can I do that on locally?
1 vote
2 answers
369 views

Send custom ERC20 tokens and deduct gas from master/another wallet

What I have currently - Master wallet : Contains ETH balance Deploys ERC20 contracts to mint custom tokens. User wallets : NO ETH balance owns tokens of the deployed contract. Contract : Custom ...
0 votes
2 answers
813 views

Create a MAX SUPPLY to Mint ERC20

I want to create an ERC20 on Solidity. I want 1000 TOKENS of MAX SUPPLY (Like the 21m of bitcoin). PERSON A: Mint to his wallet 700 Tokens. (Thats okey) Only 300 Tokens are available. PERSON B: Mint ...
0 votes
1 answer
1k views

get decimals from contract

What is the correct way to get the number of decimals using web3? For example, how would I get the number 6 as a result when trying to obtain USDT decimals from the contract address? I was using ...
1 vote
1 answer
28 views

how to implement payment for smart contract functions not in eth but in any erc20 token

I want to write a Smart contract where for a call to a specific function, for example, erc20Pay, not ETH will be accepted, but a regular erc20 token with a specific contract address. how can this be ...
0 votes
1 answer
448 views

Where can I find compiler info to verify & publish an ERC-20 token on Etherscan when I didn't write the code?

I'm a developer working for a small startup with a standard ERC-20 token that we'd like to verify on Etherscan, but I wasn't the person who minted the tokens initially (that developer no longer works ...
1 vote
1 answer
330 views

Help, I'm stuck : ERC20: insufficient allowance

My smart contract create a new token when it's deployed, and people can buy or sell this token. The thing is the sell function don't work and I don't know what I did wrong or not understood. Variables ...
1 vote
0 answers
14 views

How do I conduct Presale off chain? Keeping the address and the amount of coins purchased

I'm creating a presale website and a presale coin in solidity. How do I keep tract of the poeple who bought it something like whitelisting right
3 votes
1 answer
292 views

ERC20 with custom sale mechanisms?

Let's say I want to create a token, but I don't want this token to be exchanged too freely, in order to avoid too much of speculation (real estate for example). People willing to sell the asset will ...
4 votes
2 answers
2k views

Is there a way to get the logs for all transactions in a block?

I am building a system that monitors ERC20 token deposits to a large number of ethereum addresses (1-4 million). While I have not tried, I do not think that the parity clients would be able to support ...
1 vote
1 answer
42 views

When would an ERC20 return false?

According to the ERC20: Token Standard: Callers MUST handle false from returns (bool success). Callers MUST NOT assume that false is never returned! In OpenZeppelin's ERC20 contract, running the ...
0 votes
1 answer
39 views

Fail with error 'ERC20: insufficient allowance'

Getting ERC20: insufficient allowance even I'm calling approve function before calling transferFrom function in getRewards function, don't know what I'm missing in it. Cafe Contract: // SPDX-License-...
1 vote
0 answers
15 views

How to get any token contract address via network request?

is it possible to get any token contract via network request? for now I've found this repo https://github.com/ethereum-lists/tokens/tree/master/tokens/eth but still the network request way would be ...
2 votes
2 answers
2k views

ERC-20 contract from another contract

I am trying to create contract which can access functions of any ERC-20 standard token contract. At first, I'd like to get balance of given address. I run private testnet using geth, I have deployed ...
2 votes
1 answer
48 views

How can ERC20 tokens be obtained in a local hardaht forked environment?

I've been learning about ethereum for a short time, besides my English could be better; if I'm wrong about something, please correct me. 😁 I am trying to test the interaction of different contract ...
1 vote
1 answer
52 views

How do I manually unwrap wrapped coins (like wbtc not WETH)

Im not interested in just swapping the coins on uniswap, I want to unlock the value of wrapped tokens. I have a number of coins similar to WBTC that I want to manually unwrap to get the BTC back. Is ...
0 votes
1 answer
2k views

Getting Error : ERC20: transfer amount exceeds allowance

contract Token is ERC20 { constructor() public ERC20('DonkeyCoin', 'DKC'){ _mint(msg.sender, uint(100 * 10 ** uint(decimals()))); } // now we can make the approve for the msg.sender the amount it ...
2 votes
2 answers
11k views

can't verify contract on etherscan (But we were unable to locate a matching bytecode (err_code_2))

so i'm trying to verify a contract on rinkeby and ropsten... getting the same error of "Compiler debug log: Error! Unable to generate Contract ByteCode and ABI Found the following ContractName(s) ...
0 votes
2 answers
328 views

Can an ethereum token name have numbers in them?

So let's say a token is called USDC. Well can we have one called 1usd or 43g something like that? Or must they all be uppercase letters. Thank you.
0 votes
1 answer
524 views

Unable to verify if a contract's tokens is greater than the requested amount by ther buyer

I want to explain you the problem so that you don't need to read the whole files. BirTokenSale contract is trying use the tokens given to it by another contract ,BirToken contract, and send the money ...
1 vote
1 answer
347 views

Receiving ETH payments

As someone more familiar with bitcoin than ethereum I'd like to ask what would be the best way to accept ETH payments as a merchant? With bitcoin I can do following and my question is if it makes ...
0 votes
2 answers
793 views

Why eth_getLogs returns empty result for Ethereum account address?

I'm developing an Ethereum platform and need to fetch the events log of a desired address. I found a code like this: curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":...
1 vote
2 answers
1k views

Cant pass large uint in react.js (2**256-1) into solidity approve function

I am trying to call a simple approve() to allow my contract to spend my tokens. Trying to make the amount argument = (2**256 - 1) however I am getting the below error message every time. Unhandled ...
1 vote
1 answer
35 views

When someone sends me a erc721, does my wallet actually receiving it?

Like erc20, when someone sends me a erc20 token, they're not actually sending the tokens to my address. Instead, they're sending a transaction to the Ethereum network that calls the transfer function ...
1 vote
1 answer
100 views

How to add ERC-20 symbol and logo to UniSwap?

We’ve created an erc-20 token and deployed it on Eth mainnet and listed plus added liquidity and received the LP’s on UniSwap. At the moment, on UniSwap, we can only search for the token by its 0x... ...
0 votes
1 answer
81 views

ERC20 increaseAllowance exploit?

I have my own smart contract. Users on my webpage needs to first approve (increaseAllowance) and then they call "donate" function and part of the assets are sent to my vault and the other ...
3 votes
1 answer
158 views

What are Hooks and How are they used? Went thorough the explanation on the topic but can't wrap my head around it

So in the ERC720 contract there is a _transfer function which is calling a hook named _beforeTokenTransfer(). As we see in the image _beforeTokenTransfer is called and I understand it may be calling ...
0 votes
2 answers
3k views

"VM Exception while processing transaction: revert" in Truffle test and Truffle dev

this is my problem :) Issue "Error: Returned error: VM Exception while processing transaction: revert" when reaching the Transfer function. I think it is related to the fact that my Crowdsale smart ...
1 vote
2 answers
58 views

Error with getting balance of an ERC20 token for a wallet address solidity

I tried calling this function : function createBorrowerCentricService (address _borrowToken) public returns (uint256) { BorrowService storage borrowService = borrowingServices[...
1 vote
2 answers
27 views

Is it possible to distinguish users, who send tokens/eth on single address?

I know that the easiest way is to generate new address for every user and then withdraw token/eth from it, but this requires additional tx fee payment. Is there any way how I can determine users by ...
0 votes
1 answer
303 views

ParserError when trying to compile ERC-20 smart contract

I am new to Solidity, and as an exercise, I am trying to create an ERC-20 token. However, I am encountering an error, and I can't seem to figure out what the issue is. The error I am getting is ...
2 votes
1 answer
317 views

If a function calls another contract function that throws, will the initial function throw as well?

If I call a function in another contract that doesn't return a boolean, but has throw() invariant checks, is it safe to assume the function finished properly if the transaction isn't reverted? I ask ...
2 votes
4 answers
293 views

Is it possible Refund the ETH within ERC20 Contracts?

if user sent the 1.5 ETH then accepted the 1 ETH, but 0.5 ETH should be refunded to sender. I tried like msg.sender.transfer(0.5) and tried like msg.sender.transfer(500000000000000000) but nothing ...
2 votes
3 answers
537 views

Given transaction hash, how to proof that it was a successful erc-20 token transfer using web3?

I have a transaction hash and an RPC access to fully synced node. How to check if the token was actually moved? The transaction might be old, so there is no point in querying the contract. If I ...
2 votes
1 answer
21 views

call method problem in solidity

I have simple contract and it has a function to call ERC20 token contract: function _approve(uint256 amount, address to) external payable returns (bool){ (bool ok,) = linkTokenAddress....
0 votes
1 answer
605 views

Setting ERC-20 token price

I'm currently trying to set the token price of my ERC-20 token.The problem I'm having is trying to set the price to ETH(0.01) per token, but the closest value I keep getting to is ETH(0.001) per token ...
1 vote
1 answer
30 views

Search etc-20 tokens by name on UniSwap

We’ve created an erc-20 token and deployed it on Eth mainnet and listed plus added liquidity and received the LP’s on UniSwap. At the moment, on UniSwap, we can only search for the token by its 0x... ...
1 vote
1 answer
68 views

TranferFrom in delegate call

I have an ERC20 test contract, also I did multicall with delegatecall function instead of call. I have a three accounts: account1, account2, and account3. account1 can spend tokens from account2 (I ...
0 votes
1 answer
449 views

Adding max tx percent ERC20

I can see that many ERC20 tokens that has recently launched has an "set max tx percent" before adding liq. What does it stand for? Is it to stop bots to buy upp all tokens as soon as liq has ...
0 votes
1 answer
311 views

Metamask false positive error: ERC20 transferFrom tx displays "Exception thrown" error in metamask, but tx confirms fine

I'm fairly certainly this is due to approvals- that metamask thinks that an error will be thrown because the contract does not have approval to transfer the ERC20- even though the approval tx is ...
1 vote
1 answer
616 views

ERC20 Event Listener in Rust Programming

I am trying to program an erc20 event listener using Rust programming language and trying to get events from a particular block to the latest block. But even though I have specified from the block it ...

1 2 3
4
5
50