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
31 views

Approval question

Beginner question: I have trusted wallet with 1000 LINK erc20. I want to swap it to get USDT erc 20. It ask to approve the LINK. How long approval takes? In some time after I got the USDT, I wish to ...
0 votes
1 answer
54 views

ERC20 token transfer failed When getting called by a smart contract

I'm developing a smart contract in Remix, and it is compiling correctly, but every time I try to execute functions related to the transfer function from my token ERC-20, it returns me an error saying ...
1 vote
0 answers
23 views

ERC20 total supply distribution

For an ERC20 token, what is a typical total supply distribution? I'm about a month into solidity, coming from a .net full stack background. I have got a contract developed including adding liquidity ...
0 votes
1 answer
2k 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/...
5 votes
2 answers
20k views

How to know if Dev renounced ownership of smart contract?

Any help would be greatly appreciated. Also if someone can show the difference between a renounced and unrenounced coding that would be helpful.
12 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 ...
1 vote
3 answers
4k views

Clarification on decimals and ERC20 token amount

I am creating an ERC20 token and have specified decimal as 2 since the token can have values like 10.32 When I minted 1000 coins using smart contract invocation from my dapp, I got 10 coins in my ...
0 votes
0 answers
41 views

How to get the ERc20 token price

how to get the erc20 token price like in chain link from this code i am getting the token price of price feed address but How to get my own erc20 token price from chainlink // SPDX-License-Identifier: ...
1 vote
1 answer
28 views

Robust way to index historic total supply for all ERC20 tokens

Is there a robust way to index historic total supply for all ERC20 tokens? For tokens that update total supply through mint and burn (with proper events), this is easily done by tallying up mints and ...
2 votes
1 answer
32 views

Getting error ERC20: insufficient allowance even after the user approving the tokens. Need help with debugging

The following code is from a Stablecoin project. To gain more context, please refer to this Github repo. I've added a new function to the DSCEngine.sol name collapseDsc() which is responsible for ...
2 votes
2 answers
708 views

What is best practice for transferFrom out of these two ways

I want to know which among these is best practice when dealing with transferFrom. that is when one should wrap it in require and when not to. require(token.transferFrom(msg.sender, address(0),token ...
0 votes
1 answer
37 views

How to Download dependencies when auditing a hardhat project?

I just attempted to audit smart contracts that were tested using the Hardhat framework. In Foundry, after cloning the repository, I know that I can install all the necessary dependencies by simply ...
1 vote
2 answers
1k views

How do I set an image for ERC20 tokens on Etherscan?

The picture above is an example. I want to set an image on the ERC20 token I created and display it on the Explorer page. Can anyone tell me how to set it up?
0 votes
2 answers
38 views

Deploying contracts at same address

// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; /* Let's say Alice can see the code of Foo and Bar but not Mal. It is obvious to Alice that Foo.callBar() executes the code inside Bar.log(). ...
0 votes
3 answers
1k views

Error encountered during contract execution [invalid opcode: INVALID]

I was using Web3.py to send Tether from address A to B: w3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/REDACTED')) teth = '0xdAC17F958D2ee523a2206206994597C13D831ec7' # ...
1 vote
1 answer
2k 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
2 answers
88 views

ERC20 token smart contract check

I updated my smart contract code according to the explanations you gave and the instructions you gave. Please, if possible, check the rewritten code again and give your general opinion, is this smart ...
0 votes
1 answer
428 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
1 answer
32 views

How to get the token Price Of ERC20 token in same contract

How to get the token Market price value in the solidity smart contract. I want to fetch the token price in the same contract like there is A token and I want the token Market price value in the same ...
0 votes
1 answer
913 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
1 answer
691 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 ...
1 vote
2 answers
410 views

How did this address steal my Ethereum ERC-20 Tokens?

A person on Twitter told me about this DApp that gives her 1% ROI each day and since I was new to crypto and her lies was really believable to me and I had really big FOMO. I first put 100 USDT into ...
0 votes
2 answers
807 views

How to import Openzep ERC20: Identifier not found

Can I get someone's perspective on why I'm unable to find the ERC20 contract I've npm install @openzeppelin/contracts. After import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; I get a ...
3 votes
2 answers
589 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
0 answers
10 views

I am not getting the starknet plugin from the plugin section

I am completely new and I want to deploy a contract on the eth network with my argent wallet. But I am surprisingly not getting ant starkenet plugin in the plugin menu. And no not even if I use other ...
0 votes
1 answer
838 views

why does ERC20 Token Balance shows 0 frequently?

I have a DAPP and ERC20 Token which has an initial supply of 9000 for testing purpose..First step is to login/register into the DAPP where all the information resides..There is an element in the DAPP ...
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
26 views

How should I integrate my ERC-20 Smart Contract into the existing cryptocurrency ecosystem?

I've created my own cryptocurrency based on the ERC-20 Smart Contract on the Ethereum blockchain. I want my currency to have the same functionality as Tether USDT, for example. To be more specific: I'...
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 ...
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
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
1 answer
26 views

How to get a token bluecheck from polygonscan?

I would like to ask about blue checks in polygon scans. Is there any documentation that we need to submit to receive a blue check for our token registered with polygonscan? On the polygonscan ...
1 vote
1 answer
751 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' ...
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, ...
0 votes
1 answer
60 views

"Type Error in BijliToken Contract Testing: 'before each' hook for 'Should set the right owner'TypeError: (0 , ethers_1.getAddress) is not a function"

/test BijliToken.js const { expect } = require("chai"); const hre = require("hardhat"); describe("BijliToken contract", function () { // global vars let Token; let ...
0 votes
1 answer
294 views

Function burnfrom error: gas required exceeds allowance or always failing transaction

I have created a contract using Remix. When I run the function burnFrom(), it shows: gas required exceeds allowance or always failing transaction. What am I doing wrong? function burnFrom(address ...
0 votes
0 answers
23 views

I bought a scam token. Cannot sell ! But the sandwich bot can buy and sell. How is that? [duplicate]

I bought a scam token. Cannot sell ! But the sandwich bot can buy and sell. How is that? Contract address is 0x1ebb7e40c24eb100b68d1289ec2ac130f66eb77d
0 votes
1 answer
41 views

How to give allowance to a contract and send erc20 between accounts

I wrote the following contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract enviaToken { address public ...
0 votes
1 answer
25 views

I want use own ERC20 token to buy things

I create my own erc20 token and transfer into the metamask. Now I want to use for purchase things which i am listing on the website .For example ,i made a shop where different things are avaliable . ...
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
1 answer
312 views

Transferring an ERC-20 using web3js 1.0.0

I have been trying to follow the web3js documentation, but it mentions things that are not native to Javascript like "Buffer" so I found a library called ethereumjs-tx to let me use that. My HTML ...
0 votes
2 answers
2k views

How many tokens are transfered actually when we are using decimals

I have a code below and when I am transferring 1,695,000,000 to a particular address, so actually 0.000000001695 are being transferred. Why is it so? Does that mean to transfer 1.695 billion tokens I ...
3 votes
3 answers
323 views

Issue with autonomous contract calling erc20 token's transferFrom for approved amount [closed]

Trying to transfer fund using ERC20 token handle and calling 'transferFrom'. Assume that the specific amount is preapproved by owner account for 'MyContract' contract address. contract StandardToken {...
1 vote
1 answer
2k views

Uniswap fork: remove liquidity error

I am trying to fork uniswap. And I have a problem when liquidity is removed. Problem in UniswapERC20. I don't know what's wrong. Step by step (repeatedly for Rinkeby and Ropsten): Copy Uniswap ...
2 votes
1 answer
33 views

How does Account Abstraction Paymaster compare the value of ERC20 and Ether?

To the best of my knowledge, the off-chain value is utilized by Chainlink and the on-chain value is utilized by uniswap's oracle. However, I don't see anything related to Chainlink or Uniswap in the ...
6 votes
2 answers
2k views

Smart contract erc20 code snippet to prevent buyer token transfers

I´m going to start a token pre-sale and I want to be able to send the tokens to the buyer but prevent the buyer to send tokens to another wallet. I tried the following in my ERC20 smart contract but ...
0 votes
1 answer
419 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 ...
2 votes
2 answers
26 views

How can this account address selled more erc20 token then it received?

I'm using the Alchemy API to retrieve all transactions for a specific address. When I run the API for this address on this particular token, I only receive two transactions. The first transaction ...
0 votes
1 answer
495 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 ...
1 vote
1 answer
23 views

Can approve function be malicious?

I'm so confused on how approve functions works: If myToken contract has an approve function but the owner did not approve the contract B. Then contract B deploys a function and create a function that ...

1 2
3
4 5
51