ERC-20 is a smart contract standard defining an interface and a set of rules for development of fungible tokens on the Ethereum platform.
Questions tagged [erc20]
462 questions
0
votes
1 answer
Swap ETH to WBTC or other alt coin by a smart contract
I am trying to create a smart contract for a gmae that is, If anyone send ETH to it's address, it divide the ETH value into two equal value and send equivalent WBTC of firs part to an address and other part send on another address with other ALT…

Jitendra
- 558
- 8
- 23
0
votes
1 answer
solidity ERC20 transferFrom gives no error but does not execute
I have a Solidity code that aims to Exchange BUSD with myToken (both ERC20) which calls a BUSD.transferFrom() and a myToken.transfer(), but despite the core executes with no errors only myToken is transferred.
The account is approved and has enough…

mortain
- 3
- 3
0
votes
1 answer
Transaction showing on etherscan.io but no showing on API.etherscan
I am trying to get the transactions of an address using
https://api.etherscan.io/api?module=account&action=txlist&address=0x9bb1499d06f3036a12f653f00b889731d04c47a0&startblock=0&endblock=92649034&sort=asc&apikey=XXXXX
however, I get the results "No…

Marci Banez
- 115
- 1
- 9
0
votes
1 answer
Solidity ParserError: Expected ';' but got 'is'
I've been learning solidity, however, I am still very new. Currently I am making a ERC20 Token but I am having some difficulties with doing so. Here is what I have.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import…

Tarxan
- 3
- 2
0
votes
1 answer
BEP20 How to exclude the burn wallet from the maxlimit function
Am trying to create a project and new to solidity.
I added a max limit to prevent whale wallets.
The limit is 150m tokens and i would like to burn a higher amount, how can i exclude the burn adress 0x0000000000000000000000000000000000000000 from…

Wooshh
- 1
0
votes
1 answer
ERC 20 approve spending tokens
when I send transaction to approve token spend it ask Metamask of the user logged to sign it but i want 1inch dex to get approval as spender, but instead my test website on localhost get this permission. My code looks like:
approveTokenSpent = async…

Mariusz Sidorowicz
- 336
- 3
- 12
0
votes
1 answer
Peg erc-20 token's price to a cryptocoin
Can anyone explain to me where the mapping or pegging takes place? Take PAXG the price of which is pegged to gold. How do I do that with my erc-20 token? Is it even written in the code or does it have something to do with the exchanges?

Roman Kartashow
- 15
- 4
0
votes
1 answer
How to properly test exceptions in Solidity?
I am new to Solidity, and I am trying to create my first smart contract following the ERC-20 token standard. As the standard requires, I have a transfer function which looks like following:
function transfer(address _to, uint256 _value) public…

Hidayat Rzayev
- 339
- 3
- 14
0
votes
1 answer
Why is constructor not being recognized when being referenced?
I'm trying to code a token and it is not recognizing constructor.. why?

user3453693
- 11
- 1
0
votes
1 answer
Revert exception error from querying wallet data using onboard.js
I'm using this code from Onboard.js:
import ethers from 'ethers'
import erc20 from './erc20'
function tokenBalance({ tokenAddress, minimumBalance, tokenName }) {
let ethersProvider;
let tokenContract;
return async stateAndHelpers => {
…

emma
- 359
- 1
- 3
- 6
0
votes
0 answers
Can't Retrieve Wallets transactions using web3js
I tried to get all the transactions of a wallet address on a certain token contract. But it keeps on returning null.
const Web3 = require('web3')
const web3 = new Web3('https://rpc-mainnet.maticvigil.com/v1/___')
const abi = [contains correct…

Dave Raa
- 3
- 1
0
votes
1 answer
Compile Error in pragma solidity 0.8.0 and others
When I try to compile my bep20 smart contract it says:
ParserError: Invalid token. --> bep-20.sol:6:53: | 6 |
constructor(uint256 initialSupply) public ERC20(“MilkyWayGalaxy”,
“MILKYGAL”) { | ^
I use the pragma solidity ^0.8.0; but the latest…

Milky
- 1
- 1
- 1
0
votes
1 answer
Receiving "invalid or does not take any parameters" when attempting to deploy a contract
here is my 2_deploy_contract.js syntax
const DerbyToken = artifacts.require("./DerbyToken.sol");
module.exports = function(deployer) {
// Deploy the Migrations contract as our only task
deployer.deploy(DerbyToken);
};
after I migrate the file…
0
votes
1 answer
retrieving the balance of an ERC20 token from an address
ERR: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node…

user13474075
- 1
- 1
0
votes
2 answers
Does approve take time to be confirmed, and how to deal with this in BSC?
Hi I am doing BSC DApp using web3 with react. I am very new to this field.
I found after call approve, the transfer(or zapInToken in my case) will not be successful with complaining not enough allowance. So I added wait allowance to be present for…

Ron
- 6,037
- 4
- 33
- 52