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
1
vote
1 answer
cannot approve contract to ERC-20 token due to ProviderError: HttpProviderError error
OracleSwap is a DEX that is a fork of Uniswap.
The end goal is I am trying to add liquidity
https://docs.uniswap.org/contracts/v2/reference/smart-contracts/router-01#addliquidity
In order to do this, first we need to approve the OracleSwapRouter…

sungazerr
- 45
- 5
1
vote
1 answer
Aprove function does not increase allowance of ERC20
I am trying to implement a simple token transfer to a Vault but I'm having trouble approving the transaction and when I run tests using foundry, I receive this error:
[FAIL. Reason: ERC20: transfer amount exceeds allowance] testDeposit() (gas:…

Laurynas Lopata
- 11
- 2
1
vote
2 answers
Passing dynamically generated values to ERC20 Constructor
Issue
Hi everyone!
I'm currently working on an website that autogenerates ERC20 token by the value supplied by user. The biggest concern i've been getting is passing user values to ERC20 constructor since it expects two arguments in the constructor…

Dami Hahfo
- 13
- 2
1
vote
1 answer
Solidity Error: We were not able to estimate gas. There might be an error in the contract and this transaction may fail
I have dapp web app with smart contract deployed on rinkeby testnet.
In my dapp website, I have token swap and stake function.
Link: https://doxa-staking.netlify.app
When I swap my ether for my token it works fine. Now on the dapp stake function,…

mintiverse mintiverse
- 13
- 1
- 5
1
vote
0 answers
How use a Bep20 token and not BNB to pay in a solidity contract?
I am new, so far I have a few hours of learning but I am very interested in continuing to learn, I was able to find a solidity contract on Github that uses the Base BNB currency as a means of payment, I would like to be able to make the contract…

CrDiego
- 11
- 3
1
vote
1 answer
ERC20 Event Listener in Rust Programming
I am trying to program an erc20 event listener using Rust programming language and trying to get events from a particular block to the latest block. But even though I have specified from the block it just gives an output from the latest block, not…

Ajit
- 338
- 1
- 10
1
vote
0 answers
MerkProof.Verify Always Retuns false on solidity but returns true frontend
I have this code for verifying a merkleproof on solidity
event beforeClaim(bytes32 root, bytes32 node, bool proof);
function claim(
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public {
…

Suliman Noor
- 84
- 6
1
vote
1 answer
Use Smart contracts mint function in nethereum with parameters
I try to build a game in unity, in which you can earn a blockchain token by minting it.
The API of the mint function looks like this:
{
"constant": false,
"inputs": [{"internalType": "address","name": "account","type": "address"}, …

user3762507
- 35
- 8
1
vote
0 answers
How to recognize and interact with contract of other chains?
I am planning to issue erc20 token on ethereum and I want to use it as a payment for dapps on polygon.
How may I estublish the interaction between the contracts? A potential answer to that question might be bridging. But I tried to look for every…

Blockchain Kid
- 315
- 2
- 9
1
vote
1 answer
What is the usage of Context.sol within ERC-20?
When releasing the ERC-20 token,
OZ(OpenZeppelin)'s util Context.sol is inherited.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the…

DongMyoung
- 13
- 3
1
vote
1 answer
How to add a logo to an ERC20 token?
I am new to blockchain. I really couldn't understand how to add logo to my erc20 crypto token on polygon before listing it on any coin market.
I want to add my own custom image to the circular portion. How can I change this current logo to…

Blockchain Kid
- 315
- 2
- 9
1
vote
1 answer
SmartContracts - how to run function with "Erc.json" (javascript) (update)
Hello guys,
I have a question
I try to smart contract functions from erc.json standarts with JavaScript. To example: I need a random number function with metamask user address(account number) referance for backend
To basicly:
Example JSON values:
…

zanthez
- 45
- 6
1
vote
1 answer
How to burn token of Smart contract from another Smart contract?
Let say there is a BEP20 token (tokenA)on the blockchain with an internal function _burn and a total supply of 100000000 token i want to write a new Smart contract that can burn token TokenA and substract from the supply how can i proceed? I've…

Rozales
- 21
- 1
- 2
1
vote
0 answers
Mock smart contract solidity - can't deploy mock smart contract - TypeError: Contract "mockMyToken" should be marked as abstract
I wrote a smart contract that uses openzepplin ERC20 standard. I am able to deploy it using truffle and my tests work as expected. I am now trying to test part of the code that is dependent on time (block.number) For the purpose of allowing the user…

James Aldridge
- 49
- 3
1
vote
0 answers
how to add liquidity using smart contract?
We are trying to add liquidity using smart contract. we have deflationary tokens which charge fee on buy and sell of token. but when we are trying to addLiquidity using uniswap or pancake swap its also charging tax fee ,So to overcome this issue and…

Axat tech
- 11
- 2