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
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
753 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
62 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
295 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
24 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
44 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
26 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
34 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
432 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
27 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
502 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
24 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 ...
2 votes
2 answers
630 views

To transfer tokens from owner address to an address, if latter address moves some other tokens to a given particular address

I am writing a contract for an ERC20 token (say ABC). Is it possible to airdrop some of these newly minted ABC tokens to those ERC20 addresses, every time, if they transfer a different token (named ...
0 votes
1 answer
22 views

With erc-1155 can you mint tokens on the fly with parameterized name and supply?

The erc-1155 contract would have various token types. Users would be able to request minting (contract owner would mind the tokens on their behalf) of any type available on the contract but they would ...
0 votes
2 answers
732 views

The use of ERC20 tokens in a private ethereum network

I am being told to use a private blockchain instead of the public one in an attempt to cut gas costs. But I was hit with the problem of the value of ether and tokens in this private blockchain. I am ...
0 votes
2 answers
394 views

How to resolve insufficient asset liquidity in 0x on polygon mumbai testnet

I am testing the 0x api to get quote on Mumbai testnet. I want to swap BAL -> wETH. https://mumbai.api.0x.org/swap/v1/quote?buyToken=0x2e3A2fb8473316A02b8A297B982498E661E1f6f5&sellToken=...
1 vote
2 answers
1k views

How to transfer ERC20 tokes from Blockchain wallet to MyEtherWallet?

I got some token and by mistake sent them to my Blockchain ETH address. Now, what is the process of transferring them to MEW? They talk about exporting your private key, what does that mean and to ...
1 vote
1 answer
1k views

ERC20 tokens in Metamask suddenly not showing

I've been using Metamask in Chrome for a while and had a list of ERC20 tokens in Ropsten network already added in the Assets section through their contract addresses: DAI address: ...
0 votes
3 answers
77 views

fallback and receive function on WETH

Does a contract that works with Wrapped Ether(WETH) require a fallback or receive functions? Let say I send WETH to a smart contract with/without fallback functions, what will happen?
7 votes
3 answers
7k views

invalid opcode: opcode 0x5f not defined

I'm new to Solidity and it's my first try to write a smart contract using Openzeppelin, Pancakeswap and BEP20 libraries basically to make a BEP-20 token. When i try to deploy the smart contract, i get ...
0 votes
1 answer
319 views

How to use web3 to send an ERC-20 token to a contract function

I know how to use web3 to send USDC tokens from one address to another, by using "web3.eth.Contract (ContractABI, ContractAddress) to create a Contract object, and then creating a data object ...
3 votes
3 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 vote
1 answer
50 views

When a ERC1155 works as ERC721 and when as ERC20?

Im trying to track in real time the holders of any ERC1155 contract, and I have this doubt about this interface. The ERC1155 can work as an NFT or as a Token, but also as both at the same time, right? ...
4 votes
2 answers
105 views

Why uint8 for decimals in ERC20 tokens?

Is there a specific reason why pretty much everyone uses uint8 for the decimals in ERC20 tokens? I would get it if it was to limit the size, because the decimals will never be big enough to exceed the ...
0 votes
1 answer
396 views

Mining pool rewards erc-20 smart contract [duplicate]

Some time ago I invested money on the defi wallet app in the dapp ehcwa.top. It showed me a few days ago that I could claim the 15 eth reward. After I pressed the "claim" button, it showed ...
0 votes
1 answer
34 views

Gas cost on mapping

I'm reading docs on Venom and they said that the problem on using mapping in ERC20 contract is "Now let's imagine that we have an erc-20 like mem-token contract with one large hashmap of token ...
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....
2 votes
3 answers
1k views

How to get test ERC20 tokens on mumbai testnet?

How I can get DAI, USDC, WETH, or any other erc20 token for mumbai testnet ? I am working on lending and borrowing platform so I need test tokens for that.
0 votes
1 answer
372 views

I need to know how to set a maximum buy limit per wallet

Yeah so I'm creating a eth token and I need to find a way that buyer have a purchasable maximum limit. Can anybody help me with that ? Can't find answer thanks a lot.
3 votes
2 answers
508 views

How to Deploy a Token Using the ERC-3643 Standard

I want to develop a smart contract using the ERC-3643 standard instead of ERC-20. Could you guide me on how to integrate this standard into my contract? Any assistance would be greatly appreciated. ...
1 vote
1 answer
36 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 ...
3 votes
2 answers
3k views

Constantly getting "Gas estimation failed" error when attempting to deploy ERC20 Token contract on Rinkeby testnet

I have included the code for the contract below. The error I get when attempting to deploy in remix via metamask is: Gas estimation errored with the following message (see below). The transaction ...
0 votes
1 answer
360 views

How can i make a simple chartjs chart with ethereum contract address

i would like to have a chart on my site that prints the last price of a certain erc20 token i have seen a widget from ethplorer but i rather build my own chart but i cant find any documentation for ...
0 votes
2 answers
193 views

How to sell erc20 token

I have deployed contract in Coinbase wallet now how can I swap my erc20 token for tether usd coins or any other crypto
0 votes
1 answer
2k views

How can I remove custom spending cap on Metamask?

When I call the approve function of the ERC20 token standard, it asks me to set a custom spending cap, as shown below. But I need to use the default value every time without clicking "use ...
0 votes
2 answers
450 views

ERC20 How to transfer the balance to a new address

I want to call the ERC20 contract with other contracts and transfer the corresponding balance to the contract caller. What should I do?
3 votes
1 answer
319 views

How to use enums for conditions on constructor?

I am learning to code with solidity. need help to solve this I have a membership system where users can have basic, gold, diamond membership types. Users can use coupons every 5 minutes and for basic ...
2 votes
1 answer
34 views

Transfer tokens to and from smart contract [closed]

I would like to have a new ERC20 token and one or two smart contracts to do automatic trade with specific cryptos. Example: I can buy 1 token from the contract in exchange for 1 USDT. I can sell a ...

1 2 3
4
5
51