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
2 votes
2 answers
1k views

How to add website link to erc20 token on etherscan.io

How can we add this official site link to our deployed contract? Like in the image below: Here is my deployed contract address: https://etherscan.io/address/0xab73a739729a21b2299761408507556d2719af89#...
0 votes
1 answer
1k views

Transaction underpriced

I used the search function, but I didn't find a solution. We want to create for our new religious NGO a ERC20 token. I got a sample contract, a Metamask account, went to redmix website and connected ...
1 vote
0 answers
27 views

MetaMask can't detect token in local network

I'm working on a local environment by Truffle and Ganache so that MetaMask is set to it. I created an ERC20 token there and imported it to MetaMask according to this guide. But, MetaMask doesn't list ...
0 votes
1 answer
427 views

How to detect if user burned tokens

Looking through the code of ERC20 tokens they have the ability to burn and mint new tokens. I want to write a nodejs program that monitors if a user burns a token and then sends them a new one if ...
1 vote
3 answers
821 views

How to get the Total Number of Tokenholders of ERC20 tokens?

Is there any simple API or datafeeds where I can just get the total number of tokenholders of ERC20 tokens?
2 votes
2 answers
2k views

Dynamic total supply for ERC20 tokens

I am trying to create an ERC20 token using the following workflow. Create a new token, let's say 'XYZ' with an initial total supply of 1000 coins. List them on exchanges and also create coin's own ...
2 votes
1 answer
6k 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 ...
0 votes
2 answers
413 views

How to call approve ERC20 and other contract function?

I'm trying to design this: user clicks the button and the button calls approve for ERC20 and call contract function that requires those ERC20s. But what happens it's that approve function succeeds, ...
0 votes
1 answer
861 views

ERC20 Token. My transfer function from my token does not work

When I call the function giveFifteenthTokens in my contract problem2_bank, it does not transfer tokens from msg.sender to recipient. Why? My Files: LoanToken.sol pragma solidity ^0.5.8; import "...
1 vote
3 answers
888 views

How can I collect the tokens inside smart contract that people will send accidentally?

I have an ERC20 token XYZ smart contract created. People will send certain amount of tokens back to the contract address to initiate certain functions. I just want to know that what will happen if ...
1 vote
0 answers
34 views

Why doesn't Openzeppelin's IERC20 has a `decimal()` function?

In my projects, getting the decimals() is an important task, so I have to sometimes manually add the function in IERC20's interface. But why isn't this function officially in the contract? What am I ...
1 vote
0 answers
25 views

Split payment for ERC20 transfers between user owned wallets

I am trying to create a solution that charges a processing fee when ERC20 payments go from user to user on our platform. I don't control the ERC20 token so I can't implement anything on that contract. ...
1 vote
1 answer
138 views

How to get all addresses with USDT balance? [duplicate]

I am trying to get all Ethereum addresses with more than 0 USDT on them. How do I do this? Then, how do I do this with any ERC20 contract?
2 votes
0 answers
53 views

Use Brownie to send ERC20 tokens to a payable function with the amount of tokens as an argument to the function

I have the following AlgoToken contract: interface StableCoin { function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external ...
0 votes
1 answer
482 views

Stablecoin smart contract

Drop in smart contract links for ERC-20 stablecoin. There is no list defined anywhere. There should be easy to understand resources in one place for new lerners. what should be the best boilerplate?
0 votes
1 answer
2k views

ERC20 token recovery

I am sorry if this is a stupid question but if someone can help I would appreciate it. first I have the keystore to where the tokens were linked to, I already sync completely to the network. I show ...
1 vote
1 answer
977 views

ERC20 Token support for metamask website payment

I have the following code working in my site to accept ethereum payments in my website via metamask.... <!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/...
3 votes
1 answer
1k views

Passing one contract instance as an argument to the constructor of another contract

I need to use the functions of the ERC20 contract in another contract. The ERC20 contract is from the openZeppelin contract library. I found the following code on a website: import "../../...
1 vote
1 answer
211 views

ERC20 Tax on sell (via swap)

I'm struggling with taxing upon swapping a token back for ETH. I can't figure out what I'm doing wrong here. I'm using Hardhat testnet forking Goerli to work with the Uniswap contracts. Also made ...
2 votes
1 answer
45 views

how to peg an ERC20 token to a stipulated price in other to make it a stablecoin [duplicate]

I'm new into blockchain development and currently challenging myself to create a stablecoin. I have created an ERC20 token but I don't know how to peg the price to the desired price. Please can anyone ...
2 votes
1 answer
260 views

swapExactTokensForETH transaction reverted, `UniswapV2: K` error (with gas wasting), selling with Uniswap GUI works fine

Facing reverting swapExactTokensForETH transaction using web3js. Tried different ways. Probably, it is important to note, this failed transaction uses a relatively large amount of Gas Fees. The code ...
0 votes
1 answer
307 views

Cannot call ERC20 mint function from another contract's payable function

Scenario: Contract A is a contract that sells ERC20 tokens Specified in Contract A using Open Zeppelin's ERC20 implementation. Contract A has a payable function that receives ether from a caller, as ...
2 votes
1 answer
75 views

ERC20 - Approve/TransferFrom vs listening to Transfer events

I've been learning about the ERC20 standard and I've seen in several places statements like If a smart contract want to detect when it receives a transfer of ERC20 tokens the standard approach is for ...
3 votes
1 answer
23 views

Issue with sending tokens after performing arithmetic operations

I'm implementing a fundraising contract where a user can create a fundraiser but when creating they must send a rewardingToken (ERC20 token) to the contract and the user also specifies a token which ...
0 votes
1 answer
483 views

Monitoring uniswap pair buy and sell transactions via the logs filtering

Can anybody suggests the way to retrieve an Uniswap pair sell or buy transactions, filtering the events logs. I know, it's possible to monitor an token transfers continuously scanning token Transfer ...
3 votes
0 answers
28 views

Query Transactions between date ranges with Infura

I need to query ERC20 and ETH transactions by a date range and not simply get a paginated batch at a time. How can I do this?
1 vote
1 answer
338 views

Is there a protocol to transfer erc20 tokens to multiple addresses?

I'm looking for something like described here: how to transfer ether from one account to multiple account I just thought it's such a common problem - isn't there an existing library (preferred) or a ...
0 votes
1 answer
130 views

Problem about ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File not found. Searched the following locations: ""

// contracts/OurToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract OurToken is ERC20 { constructor(uint256 ...
1 vote
0 answers
75 views

BLUR airdrop claim explained - embedding a proof into a transaction

Recently, I saw that Blur had a twitter dependent airdrop. So basically you had to tweet and then you would get the option to claim tokens. I went to analyze the code, but it is overwhelming for me. ...
1 vote
3 answers
88 views

Snapshot API for ERC20 or ERC721

I'm looking for an API that allows to export all wallets from a given ERC20 Token or ERC721 NFT. I already tried some, but most of them take multiple minutes to respond, which is too slow for us, as ...
1 vote
3 answers
671 views

Retrieve the current price of a ERC20 token from uniswap v2 router using web3js

I'm really stuck on getting the price of a erc20 token for 1 wETH if the token can have a dynamic decimal. I tried to play with values dividing them by token's exponentiation decimals in different ...
0 votes
1 answer
496 views

How to interact with mainnet smart contracts by GOlang?

Please tell me an example of code in GOlang that connects to the contract and checks the balance of the ERC20 token / transfer tokens / gets the name of the token. I looked for examples and did not ...
0 votes
1 answer
1k views

Opensea - To first time sell I need to sign messeage & Sign a message using your wallet to continue but it shows error afterwards [Picture shown]

This is my first time selling and it says that I need to "sign message" shown here. I did that but I got the error is shown below instead of approval: Any advice on how I can fix this issue ...
0 votes
4 answers
405 views

Use custom ERC20 addresses

I am pretty new to the Ethereum and ERC20. I am willing to create an ERC20 token. I see that ERC 20 tokens can be transacted using the Ethereum addresses. However, I am wondering if it is possible to ...
0 votes
1 answer
148 views

Where can I find an example of a sponsored transaction (ERC-4337)?

I know this is the standard repo but I am not finding an actual example on how I can send a transaction from an account, paying for gas fees in an ERC20 token (paymaster providing ETH once tokens are ...
1 vote
2 answers
312 views

function approveAndCall error

I creat token contract using remix. The function approveAndCall code is following. function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { ...
1 vote
1 answer
484 views

What is the best way to divide BN by a decimal?

I am using ethers npm library to divide BN by a decimal. The account(0x..) has 10.99999 GLD. const {ethers} = require('ethers'); const token = myGoldContract.balanceOf('0x....').toString(); console....
1 vote
1 answer
748 views

Lock multiple batches of ERC20 tokens for a certain amount of time

I need to build a smart contract where users can lock their ERC20 tokens for a fixed amount of time (same amount of time for all users, e.g. 1 year). Lets say a user locks 100 tokens and half a year ...
1 vote
1 answer
83 views

Error with supportsInterface function (ERC165)

I have this function: /// @dev Checks if the type of asset-contract is same as the TokenType specified. function _checkTokenType(Token memory _token) internal view { if (_token.tokenType == ...
2 votes
1 answer
153 views

What is the difference between "Matic" and "Matic Token"?

I found "Matic Token". Contract Address: 0x0000000000000000000000000000000000001010 PolygonScan Link: https://polygonscan.com/token/0x0000000000000000000000000000000000001010 I have ...
0 votes
1 answer
13 views

An ethereum token standard for minting and burning only

Does there exist a token standard (ERC or EIP) that has an interface similar to below? interface token { function totalSupply() external view; function mint(address _account, address _amount) ...
0 votes
2 answers
3k views

How to find ABI and verify my contract

When I try to verify my contract , it returned: Note: Contract was created during TxHash# 0x8a13fd16a810e886266d49addf46e459847d583528f966561e45abdd34a13e14 Result: Does not match the input creation ...
2 votes
1 answer
398 views

How to add my token to external exchange

I am planning to launch one ICO and before that I am checking how to list my coin in external exchange? If anybody knows please help here What are the mandatory things I have to consider
0 votes
2 answers
660 views

Prevent Transfer of ERC20 token to contract address?

I want my ERC20 contract to be transferred to EOA addresses only and some specific contract address only. I don't want to lose my tokens by mistakenly transferring to a contract address that cannot ...
0 votes
1 answer
116 views

Is it possible to burn tokens that are in a contracts balance?

As the title states, is it possible, to burn tokens that are in the balance of a contract? I made a mini game where the person who calls the external function, it suppose to burn the tokens in the ...
0 votes
1 answer
13 views

Why do ICO startups mostly prefer ERC20 tokens for raising funds?

Can anyone create ERC20 tokens on their own? Does it need any technical expertise? Provide whatever information you know relevant to this question. It will be helpful even for newbies who are visiting ...
0 votes
2 answers
116 views

I can't make my first NFT sell

A buyer reached out to me on instagram. Sent me a QR Code. I saw the price. She made the payment to the network. She's clean. I'm clean. But things get complicated from this situtation: My NFTs are on ...
5 votes
2 answers
1k views

Someone has "faked" transferring 0.00 ERC-20 tokens from my and many other addresses

Someone has created a tx in which my address has supposedly "transferred" 0.00 USDC tokens to another address on Polygon, along with dozens of other addresses also transferring 0.00 DAI/WETH/...
0 votes
3 answers
59 views

How to develop a swappable ERC20 token?

I am developing a BEP20 token. The employer wants this token to be swappable in PancakeSwap. When I read source of similar tokens, they add IUniswapV2Pair, IUniswapV2Router01 and IUniswapV2Router02 ...
1 vote
2 answers
2k views

How to initialize and assign value to constant in constructor?

I have the following code and want to initialize a constant in constructor. import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract IToken is ERC20 { uint256 private ...

1
3 4
5
6 7
50