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
31
votes
19 answers
File import callback not supported?
Tried to run:
1.) Dappuniversity project (dappuniversity/dbank)
2.) pet-shop-tutorial
Truffle v5.3.3 (core: 5.3.3)
Node v14.15.5
How can ser compile code @ the 0.8.4 to import OpenZeppelin’s ERC20.sol template, when Truffle requires it’s…

GoGetterMeme
- 429
- 1
- 5
- 5
20
votes
2 answers
what approve and allowance methods are really doing in ERC20 Standard?
The problem is what allowance and approve are really doing?
And what is _spender and what is it doing?
Is there anybody who can explain it to me?
contract Token {
uint256 public totalSupply;
function balanceOf(address _owner) constant…

shahabvshahabi
- 937
- 2
- 7
- 18
16
votes
5 answers
How to send an ERC20 token with web3js
I'm currently using the 0.2x.x version of the Web3 JavaScript API. I deployed my custom ERC20 token by creating smart contract in solidity (on REMIX IDE).
I installed the MetaMask and had a test on https://wallet.ethereum.org/ to send some custom…

rachel_hong
- 471
- 2
- 6
- 15
10
votes
1 answer
How to send ERC20 token to smart contract balance?
I'm trying to build a smart contract and inherit some functions to swap ERC20 tokens,
Here are my questions?
Question A:
Is it possible to transfer ERC20 token to smart contract balance?,
Please provide an example,
i.e. We can create a function to…

Giorgiu
- 199
- 1
- 3
- 10
10
votes
1 answer
Send ERC20 token with web3.py using a local private key
I am trying to send ERC20 tokens in python with web3.py using a local private key.
With this code I can send ether:
w3 = Web3(HTTPProvider('https://api.myetherapi.com/eth'))
signed_txn = w3.eth.account.signTransaction(dict(
…

user9915065
- 101
- 1
- 1
- 3
10
votes
4 answers
How to detect if an Ethereum address is an ERC20 token contract?
If I only get an Ethereum address from the input, is there a way to find out whether it matches the ERC20 token standard?

kaichen
- 157
- 1
- 2
- 7
9
votes
2 answers
How do I find the tax of a token programatically?
I'm trying to fetch the Buy or Sell Tax of a BSC token, but I haven't found a way yet.
I query the DEX via router_contract.functions.getAmountsOut(web3.toWei(1, 'Ether'), [ buying_token_address, pair_token]).call() (in this case pancakeswap), but…

Crypto7
- 91
- 1
- 2
9
votes
4 answers
how to withdraw all tokens from the my contract in solidity
Can anyone help me?
I created a basic contract.But don't know the withdrawal function.Please help me.Thanks everyone
I tried creating a basic function but it doesn't work
function withdraw() public {
…

learn code
- 91
- 1
- 1
- 3
9
votes
3 answers
run solidity code after every x amount of time
I am creating a dev application in which after for example every 5 minutes would like to run some code from my erc20 token's smart contract. How can I call that function after every 5 minutes in solidity?

geo10
- 366
- 2
- 11
8
votes
2 answers
How can we get token holders from token?
I have created my own ERC-20 token (AJR) and deploy on Ethereum private node, Now I want to list all the transaction by Token name.
Also, I need to list down all the token holders by using contract address or token name.
I try to fetch using web3…

Trimantra Software Solution
- 3,223
- 2
- 25
- 44
7
votes
1 answer
Check balance of ERC20 token in Hardhat using Ethers.js
I'm writing unit tests using Hardhat's mainnet fork, and for a test I want to check the owner account's initial balance of an ERC20 token, in particular DAI. Here's my test so far:
const { ethers } = require("hardhat");
describe("Simple Test",…

Jasperan
- 2,154
- 1
- 16
- 40
7
votes
1 answer
Error: Returned error: The method eth_sendTransaction does not exist
I am trying to transfer an erc20 token from contract address to an ETH address using this code:
var _from = "from Address";
var contAddress = "contract address";
var _to = "to address";
var _Amount = '50';
var txnObject = {
"from": _from,
…

Muhammad Noman
- 155
- 1
- 5
- 12
7
votes
0 answers
How can i increase my erc20 token price by web3 js?
How can I increase my erc20 token price? when I see BNB token from Etherscan, there I can see the price but my token price shows $0. How can i increase price?
When in Binacne platform, BNB token Buy and Sell happens, then the rate show's in…

md shaiful islam
- 123
- 1
- 5
6
votes
3 answers
what's the purpose of the approve function in erc 20
I'm new in solidity and erc20, so I read ERC20 description on the openzeppelin and find this function which isn't clear for me.
approve(spender, amount)
What's the purpose of allowing to the spender spend my token, instead of send my tokens to the…

Nikita Duginets
- 163
- 1
- 6
6
votes
2 answers
Using web3js get coin price on uniswap and sushiswap exchange without using their api
I want to get token prices for uniswap and sushiswap exchange by using web.js
I am new to the crypto dev world, so please elaborate as much you can and if possible an example will be a lifesaver.
This is the best shot I could make... but don't know…

AtiqGauri
- 1,483
- 13
- 26