New answers tagged erc-20
0
votes
i am getting attribute error while running erc20 brownie project on rinkeby testnet
You should post your source code and the main error, not the whole console output without source code.
That being said, the error:
AttributeError: Final argument must be a dict of transaction
...
0
votes
Transfer ERC 20 tokens from a wallet which has no eth
Send your eth to wallet-A. wallet-A without any gas can't do anything but read.
0
votes
Get Token Balance of Address at Particular Block Number with Alchemy
We've released a new and updated version on how to get token balances that specifically includes the block number parameter as well. Check it out https://chainstack.com/ultimate-guide-erc20-token-...
1
vote
Accepted
Is it possible? send ERC20 token from user to user, but server pays gas fee
To begin with, there is no trivial way to achieve this. All of the options are a bit advanced.
Using transferFrom requires the token owner to give allowance to withdraw the tokens, and usually giving ...
0
votes
Accepted
Can an upgradeable token appear in the asset list?
Credit to the Gnosis team on Discord for this answer to my question:
It turns out that a token with an empty name and symbol will not be displayed in the asset list on Gnosis.
The contract given in ...
1
vote
Web3 Chainstack Guide to Batch Transactions gives Error: This contract object doesn't have address set yet, please set an address first
new versions of web3js have been released with changes in the API so you have to make sure to run the code in the article with the specific versions.
On the other hand, we've released an updated ...
0
votes
ProviderError: Error: Transaction reverted: function selector was not recognized and there's no fallback function
I got this error when running this on the hardhat network. Once I switched to a real network like kovan it worked.
If you're hitting this error try running against a real network.
0
votes
Accepted
How IncreaseAllowance and DecreaseAllowance function solve mitgation problem?
If you follow the links you'll end up to the description of the vulnerability: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/edit . Basically an attacker (the one who ...
0
votes
How IncreaseAllowance and DecreaseAllowance function solve mitgation problem?
In mitigation problem , If suppose Alice allows Bob to transfer N ERC20 tokens , initially and then changes want to change it to M. Then Bob can transfer N+ M Tokens , but using increaseAllowance or ...
0
votes
execution reverted: "ERC20: insufficient allowance" on transfer method (not transferFrom)
Have you checked balanceOf() with address of smart contract? Does it show any balance?
Also, I don't understand why are you writing
IERC20 token = IERC20(tokenAddress);
You have already ...
0
votes
How to send ERC20 token to another account using web3.py, rinkeby and infura
Here is a tutorial on how to transfer ERC-20 tokens using web3.py. It is using web3-ethereum-defi library for token helpers.
import datetime
import os
import sys
from decimal import Decimal
from ...
0
votes
Accepted
Ethers.js: Error when calling symbol() on Maker (MKR) contract but no problem for other ERC-20 token contracts
The Maker token does not implement the optional parameters symbol and name
as proposed by EIP-20:
As you can see here, Maker uses bytes32 for symbol and name.
, where in the case of EIP-20 they are ...
0
votes
Accepted
Flashloan Arbitrage error 'SafeERC20: low-level call failed'
So I figured it out theIERC20 token; part of the smart contract had nothing to refer to so I wasn't approving anything
0
votes
Escrow.sol: The called function should be payable if you send value and the value you send should be less than your current balance
After several trying, I combined the sol from @Kerry99 and my original code, and it works perfectly!
the func approve() has been overriden.
contract MyEscrow {
mapping(address => mapping(...
1
vote
Escrow.sol: The called function should be payable if you send value and the value you send should be less than your current balance
Your MyEscrow smart contract have any issues, let me explain them:
When you declare this statement MyToken token; like storage variable, you must instantiate it with the erc20's smart contact address ...
1
vote
Can an upgradeable token appear in the asset list?
I suspect you are right that the reason is that your proxy contract is not an ERC20 contract. Since you are using OpenZeppelin upradeability, your proxy contract doesn't expose the methods of an ERC20 ...
0
votes
What address(0) stands for?
Typically, address(0) indicates an unknown/anonymous address where you would send to burn the tokens.
1
vote
How to make a transaction to wait until the first one get mined in React
Referring to https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html?highlight=transactionHash#id36
If you would like to wait until its mined you should use on 'receipt' or 'confirmation'.
...
2
votes
Can an upgradeable token appear in the asset list?
Gnosis Safe works with any ERC-20 token, including proxy tokens.
There must be some other problem that is not obvious from your question as it lacks
Method how you test with your token with Gnosis ...
0
votes
Accepted
Different gas amount for erc20 Transfer functions
Probably you are transferring tokens to an address which previously had a balance of zero
In order to understand the difference you should know the gas cost of the following operations:
Gsset 20000 ...
1
vote
How do you approve + transfer ERC20 tokens in 1 transaction?
ERC777 might help.
"The tokensReceived hook allows to send tokens to a contract and notify it in a single transaction, unlike ERC-20 which requires a double call (approve/transferFrom) to ...
0
votes
How to change balances from another contract?
You can't directly access the functions of another contract. As you have defined the interface and functions of your second contract you have to instantiate an object or reference to that second ...
0
votes
How do I send my custom erc20 token from ethreum to arbitrum?
If your token does not exist on arbitrum testate and you send your tokens from ethereum, then arbitrum would first deploy the smart contract associated to the token and then transfers it to your ...
0
votes
Smart contract is not available on the blockchain during the constructor call
it does'nt make any point of using IERC20 token = IERC20(address(this));, This can be only use where you use interface.
1
vote
Smart contract is not available on the blockchain during the constructor call
If I modify the contract as follows:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/...
0
votes
How to get my ERC20 token listed on Metamask
I'm guessing Metamask is using some sort of Popular Tokens lists from Coinmarketcap or Coingecko APIs.
If you want to appear there you probably need to be a high market cap token.
Edit: Actually they ...
1
vote
How to get my ERC20 token listed on Metamask
There's an example of how to do this on MetaMask's website -
const tokenAddress = '0xd00981105e61274c8a5cd5a88fe7e037d935b513';
const tokenSymbol = 'TUT';
const tokenDecimals = 18;
const tokenImage = '...
0
votes
Convert contract ETH to WETH via function call
did you make sure you are the using the functions correctly?
"Note: Do NOT send WETH tokens back to the WETH contract. They will be stuck there, and that isn't the way to get them refunded back ...
0
votes
What is the preferred Inheritance for ERC20 token and why?
ERC20Burnable inherits ERC20 contract so both ways are same.
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC20Burnable.sol
Inheriting ERC20 ...
0
votes
What is the preferred Inheritance for ERC20 token and why?
Found this openzeppelin's discussion
openzeppelin-contracts github discussion
1
vote
Please help me find what this function does? Is there is a way around it
Stay away from this kind of contract.
Actually, with that function in place, the contract owners can change the balances of the tokens as they prefer.
Moreover, the contract is bugged or tries to hide ...
0
votes
How can I secure my custom transferFrom function?
Please read through the ERC20 documentation to understand what the standard is about before posting questions.
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/...
0
votes
Approval and Transfer From Function in ERC 20 Tokens
How does the spender transfer these tokens?
They can use the transferFrom(from, to, amount) function. Lets assume we have addresses A and B. If A has approved B to use an amount X then B can call ...
0
votes
How can I secure my custom transferFrom function?
add an onlyOwner modifier to sensitive functions
you have to set an owner state variable, preferably on deployment and add couple of functions.
They are very familiar patterns, and you should use ...
0
votes
Accepted
Finding a balance storage slot of a token contract written in Vyper
The key in mappings is computed differently. In solidity the hash is computed on packed variables and the order is user address first and then balances mapping slot. In vyper it's the other way round. ...
0
votes
I can't deploy my Upgradeable contract using truffle plugins
const MonstersOnTheWayUp = artifacts.require('MonstersOnTheWayUp.sol');
Top 50 recent answers are included
Related Tags
erc-20 × 2244solidity × 784
tokens × 643
contract-development × 241
web3js × 176
remix × 132
ether × 130
contract-design × 110
transactions × 108
etherscan × 107
go-ethereum × 93
erc-721 × 92
ico × 79
blockchain × 76
uniswap × 71
erc-20-approve × 64
openzeppelin × 62
gas × 61
metamask × 60
truffle × 52
transfer × 51
ethereum-wallet-dapp × 50
wallets × 49
openzeppelin-contracts × 47
crowdsale × 45