Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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

How can I transfer usdt if I do not have eth on account?

Is there any way I can transfer the usdt if I do not have any eth on my account? Actually I want to develop a payment gateway and give each customer an address to pay usdt, Once the payment done, the ...
0 votes
1 answer
1k views

How to handle transferring ERC20 tokens (such as USDT) with delegation to pay the gas fees on behalf of users?

I am working on creating wallets and generating addresses to be provided to a number of users. I am wondering how can I enable them to transfer their ERC20 tokens(such as USDT) without having any Eth ...
0 votes
2 answers
422 views

Transfer existing ERC-20 to BSC

We have an existing running ERC-20 token on main net whith around 200 holders . We would like to move to Binance smart chain or TRON blockcchain as it offers high throuhput and lower tx fees. How ...
0 votes
2 answers
1k views

Truffle Test AssertionError: error message must contain revert

I can't figure out why this error occurs Here my test js code: var YarockToken = artifacts.require("./YarockToken.sol"); contract('YarockToken', function(accounts) { var tokenInstance; ...
0 votes
1 answer
689 views

How ERC20 Token balance are recovered during Ethereum chain rolling-back

My Answer: Ok, the problem is really with Ganache ... If I use geth, everything is alright. ... ... sorry for your time ... ---------------- The Original Question -------------------- My ...
1 vote
1 answer
526 views

What does this balanceOf function do?

function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } Does the ...
1 vote
1 answer
915 views

How to add a donation function in a smart contract

How would I add a donation function to this type of smart contract https://etherscan.io/address/0x39E5BD6AE0f2aA9240D2ae7fBF49e36F05dd339F#code Basically, what I would like to do is have a small fee ...
1 vote
2 answers
3k views

Ethersjs - get ERC20 contract decimals

I have the following: import { ethers } from "ethers"; import { ws } from "../providers/node"; import abi from "../abi"; export default async (address: string) => { ...
0 votes
1 answer
447 views

Token Price on Swap and CEX/DEX

My question is actually almost similar with this one : How to keep the token price in uniswap the same with the centralized exchange I want to know how to sync token price more deeply : From the link ...
0 votes
1 answer
83 views

Permit and transferFrom function called on an ERC20 which drained a specific token in my wallet

I recently found out I've been drained of around 1600 $ALT tokens in two separate transactions a few days ago. It sucks to lose money, but it sucks even more if you never know how it happened and what ...
1 vote
0 answers
11 views

Tracking total sold not total supply?

I am setting up a pre sale contract, it enables users to purchase the tokens via a prelaunch which they are distributed from the owners (our contract owners) wallet when a user buys them. How are ...
1 vote
1 answer
53 views

Building Cryptocurrency Tracking system for monitoring stolen cryptocurrency transactions

When hackers steal tokens from an account, what they generally do is divert the flow of tokens via multiple proxy accounts making it complicated for the cyber-forensics department to track final ...
0 votes
1 answer
3k views

execution reverted: "ERC20: insufficient allowance" on transfer method (not transferFrom)

I'm developing a Smart Contract that transfer tokens that are owned by the Smart Contract itself. The function to do that is pretty simple: pragma solidity 0.8.1; import "@openzeppelin/contracts/...
0 votes
1 answer
916 views

調用transferFrom的函數時出現錯誤顯示Reason provided by the contract: "ERC20: transfer amount exceeds allowance

What's the problem? pragma solidity ^0.6.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/Initializable.sol"; import "https://github.com/...
0 votes
0 answers
41 views

How I can sent ETH using alias 0xEe address?

How do I send ether through a smart contract using the 0xE alias for it in transactions from the UI? I've been sitting and racking my head for the fifth day. Here's an example of my function, tell me ...
0 votes
0 answers
24 views

Bridging ERC-20 Tokens to SPL Tokens with Tax Features Using Wormhole or Similar Platforms

I'm exploring the possibility of bridging ERC-20 tokens to a similar contract on the Solana blockchain using Wormhole or a comparable platform. My primary concern is the retention of specific token ...
2 votes
2 answers
460 views

How to read multiple destination transactions?

I have a system that read normal token transactions with the 0xa9059cbb method, but now I'm receiving transactions like this 0x5ed78dc97ed6c4a3797be99f04977bbcfd45ca5c0ae97ade16dce69e7ecc558a with ...
1 vote
1 answer
3k views

How to calculate buy/sell tax for an erc20 token?

I want to find buy/sell tax for a given erc20 token sorta like how honeypot.is is able to give that information. To do this I am simulating a swap on hardhat. The only problem is I am unable to find ...
0 votes
1 answer
37 views

How to automatically burn ERC-20 token occasionally?

Is it possible to burn specific amount of ERC-20 token occasionally on some specific web hook event? For example: On a blog site when a new post is published on specific tag, then n amount of token ...
0 votes
1 answer
586 views

How to get v,r,s value for permit() signed token approval for a gnosis-safe as the owner?

I have a gnosis-safe and an ERC-20 contract with permit(owner, spender, value, deadline, v, r, s) method that requires v,r,s of the owner as the argument. I have calculated the required v,r,s value ...
0 votes
0 answers
23 views

Fail with error 'Incorrect Ether amount'

I am trying to set up a very basic presale using Remix IDE. 0x96AAC35C248C48418eF9A939e3eB8b9a64207532 --> Presale Contract 0xF60EeA9ab4B520846CA01D368A08cD4b71B619f8 --> Token itself This is ...
2 votes
1 answer
4k views

How do I automatically mint ERC-20 Tokens Every time the owner wallet transfers coins

I want to start with a total_supply of 1,000 Tokens in the owner wallet. Each token will represent a gram of gold. Every time 1 token is transferred from owner wallet to another wallet, the owner ...
3 votes
2 answers
615 views

Identifying ERC-721, ERC-777, & ERC-223 Contracts in the EVM via eth.getTransactionReceipts(), etc

Is there any specific way of identifying ERC-721, ERC-777, & ERC-223 contract events under the EVM, specifically under the eth.getTransactionReceipt() function? I know there's a way for ERC-20 ...
0 votes
1 answer
782 views

ERC20 vulnerability? Executing transferFrom undesirably

Say I have a contract called MyContract, and I require to send 100000 DAI to it. Ideally, I'd firstly call approve(<address of A>, 100000e18) in DAI's contract itself. Secondly, I'd execute, for ...
0 votes
1 answer
18 views

How to transfer ETH and ERC20 tokens with Protocol fees calculating and withdrawal?

Good afternoon. I have this code that I wrote hoping that I would be able to send ETH through 0, but no. I understand that I need to send it via msg.value but then I don’t understand how I can code it ...
0 votes
2 answers
51 views

HD wallet sending ERC-20 tokens from two child addresses

Imagine that my privacy conscious wallet always creates a new child address to receive tokens. And imagine I was sent 2 USDC from Alice and 2 USDC from Bob. My mental model is that the USDC token ...
3 votes
2 answers
1k views

How can I stop bots from using my smart contract?

My use case involves a contract with a fixed prize pool, users interact with the contract by making a payment and receiving a reward, I made it so in the long term the reward is greater than the cost, ...
1 vote
1 answer
820 views

I get error 503 while claiming 0.2 Goerli ETH on Alchemy

I'm trying to get 0.2 Goerli ETH in the testnet token faucet, but when I paste my address to claim and I request the amount, I still get the following error: 'Request failed with status code 503' ...
0 votes
1 answer
1k views

Flush ERC-20 contract token from another contract

I am trying to send ERC-20 token that was deposited to my contract address to another address. Here is the ERC-20 contract code - pragma solidity ^0.4.11; /** * Math operations with safety checks ...
0 votes
3 answers
3k views

Automatic ERC20 Token Payment System - How to

Before starting to detail my problem, I must say that I am new to ERC20 Tokens and I write this question in ask for guidance. Is it possible that I can forge a payment system on an ERC20 token? What ...
0 votes
1 answer
21 views

ERC20Votes.sol clock() function returns Sepolia Ethereum block number on Sepolia Arbitrum Testnet

I have an ERC20Votes contracts on Sepolia Arbitrum testnet. https://sepolia.arbiscan.io/address/0xc5A117C14F6117CB3870a628e02D2827B5E69471#readContract Why does the clock() function return the Sepolia ...
1 vote
1 answer
1k views

Is it possible to have 0% buy fee on DEX and 5% fee on Sell DEX and also when token is transfer?

Token Tokenomics will be like this: Buy: 0% Sell/Transfer: 5% and 5% goes to charity address. This is the token contract:https://bscscan.com/address/0xfe03a2004648886987cf4b8fd433b1b132740121#code ...
0 votes
1 answer
76 views

Differentiate a swap and normal transfer on erc-20 token transaction

Hey i’ve been following this guild (https://stackoverflow.com/questions/67998154/how-to-calculate-the-total-volume-transacted-for-a-token-on-rsk) in the ✔️ answer section to calculate the volume for ...
1 vote
1 answer
660 views

Trying to call a mint function to a deployed erc20 contract using ethers.js

I'm building a react app which currently is able to connect to a wallet and display some data from a few deployed contracts. Upon connection to a wallet, I want to mint 1000 units of a token which I ...
5 votes
3 answers
1k views

What's the reason ERC-20 standard allows 0 value transfer?

ERC-20 says transfer and transferFrom should allow 0-value transfer and fire Transfer event. What's the main benefit of allowing 0-value transfer? Is there any use case?
0 votes
1 answer
102 views

Can we upgrade the Name and Symbol of ERC20 Token

Exploring Options: Can the Name and Symbol of an ERC20 Token be Upgraded? 🚀 Seeking insights from the crypto community! 💡Considering a potential upgrade for our ERC20 token's name and symbol. Any ...
3 votes
1 answer
2k views

Contract Fallback function with ERC20

I see the fallback function of a contract as a way of "depositing" an Ether value to the contract. My question is very simple I guess, but I couldn't find the answer yet. Is it possible to develop a ...
2 votes
2 answers
68 views

ERC20 without approve

Is is good practice if I have a custom-made ERC20 that takes its own tokens out of the user for doing other stuff? I ask since doing it this way there's no need for the user to call approve() ...
0 votes
0 answers
479 views

How to get taxation feature on token transactions on uniswap?

I have an ERC20 token contract deployed on mainnet. // SPDX-License-Identifier: MIT pragma solidity <=0.9.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@...
0 votes
1 answer
609 views

Send ERC20 token from a forwarder contract address to another address

I am having difficulty spending the funds in a smart contract address. The smart contract address was generated using an ETH forwarder smart contract - https://github.com/primozkocevar/SigWallet-ERC20/...
1 vote
1 answer
20 views

How do you get the amount of shares issued by a ERC-4626 deposit?

You can call previewDeposits but from what I've read it's not actually guaranteed that the amount of shares issued will be equal to the value returned be previewDeposit. There doesn't seem to be any ...
0 votes
1 answer
30 views

Getting "insufficient allowance" error

// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./TokenA.sol"; import "./TokenB.sol"; contract ...
0 votes
1 answer
36 views

How to use stable coins for transactions on any chain

i am trying to implement such a smart contract where it takes the stable coin of that chain and send and receive it. For example i am deploying my smart contracts on the mumbai-polygon testnet. And ...
0 votes
1 answer
31 views

how to call swapETHforexactToken in https://goerli.etherscan.io/

first of i deployed a contract address in the https://goerli.etherscan.io/ and i use the uniswap v2 router2 (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D) in my contract. the token address of the my ...
0 votes
0 answers
17 views

Using Token in an application as asset

There is a smart contract deployed on ethereum network, which is an ERC-20 standard token We want to use this token in an application as a virtual currency, for example users can buy it via fiat and ...
0 votes
1 answer
90 views

ethers js queryFilter for ERC20 list of addresses

Is there a way to get the list of transferred ERC20 tokens to a list of addresses in one call. Right now I am running const events = await contract.queryFilter(erc20Contract.filters.Transfer, ...
0 votes
1 answer
35 views

ERC20 in game token restrict

I have created a game where user can claim tokens they earned. My questions is: How to restrict to directly mint from the token contract, and use only claim function within the game ? Thanks
4 votes
1 answer
6k views

How to pay ERC20 gas fee (which is payed in ETH) from another wallet?

I have a ERC20 token on a wallet called ETH (Ethereum Meta) but I don't have any ETH on that address so I can't transfer the ERC20 tokens because I cant pay the gas fee. I have some ETH on another ...
3 votes
2 answers
2k views

Approve ERC20 token inside a contract function

I would like to understand why, approving an ERC20 token inside a contract function doesn't work. Suppose that I create a function in my contract, that calls an approve for an ERC20 token for the ...
0 votes
0 answers
55 views

Pancakeswap V3 flash loan, receiving F0 error even though the flash loan has been repaid

I'm trying to finish up the callback function for a pancake swap flash loan. Everything is now working however for some reason the flash function fails due to an F0 error (ie. not paid the loan back). ...

1
3 4
5
6 7
52