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.
412
questions with no upvoted or accepted answers
6
votes
2answers
1k 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 ...
5
votes
0answers
55 views
Not able to use DAI's permit() function
I'm having trouble testing the permit() functionality from the DAI contract. I've read the documentation and a couple of other resources, although, I got the contract code and deployed myself a copy ...
4
votes
2answers
3k views
Error! Unable to generate Contract ByteCode and ABI
Having issues verifying my token contract on etherscan.io.
Receiving the following errors:
Note: Contract was created during Txn#
Result: Does not match the input creation bytecode found at this ...
3
votes
1answer
96 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 ...
3
votes
1answer
60 views
Is it possible to check the Thrid party token ( USDT ) within my ERC223 contracts?
I want to check how many tokens are received in my contracts, so that I am able to allocate MY TOKENS to the TOKEN Sender.
I tried several ways like approveAndCall, but its not working.
I don't ...
3
votes
1answer
124 views
ERC20 with custom sale mechanisms?
Let's say I want to create a token, but I don't want this token to be exchanged too freely, in order to avoid too much of speculation (real estate for example). People willing to sell the asset will ...
3
votes
2answers
265 views
Issue with autonomous contract calling erc20 token's transferFrom for approved amount
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 {...
3
votes
0answers
529 views
JSON RPC transfer of ERC20 Tokens with Parity
How can I use Parity with JSON RPC to send and receive ERC20 tokens?
3
votes
0answers
1k views
How can we lock an ERC20 token in a contract and generate another ERC20 token proportionally over the locked duration?
"Gnosis tokens (GNO) are the generator for Wisdom token (WIZ) creation. WIZ can only be created via activating the utility of the Gnosis (GNO) tokens. This is done via a smart contract system. The ...
3
votes
0answers
781 views
ERC20 Transfer Event error or intended?
I'm trying to get an Event "Transfer" for the ERC20 Token with web3 function getTransactionReceipt
event Transfer(address indexed _from, address indexed _to, uint256 _value)
You can see the term ...
3
votes
1answer
321 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 ...
3
votes
2answers
53 views
ERC standard that allows sending tokens from many origins to one destination in one transaction?
I know that any kind of operation over a token is possible so long as you implement the smart contract that achieves what you desire. For example, a function multisend can be developed that allows ...
2
votes
0answers
467 views
How to get token prices with UNISWAP API
I am using uniswap python api to get live token prices. I am using all the variation of the built-in functions. However, it does not give me the right value.
HERE IS MY CODE
address = "...
2
votes
0answers
35 views
ETH same transaction different amount of gas used
The two transactions:
a) https://etherscan.io/tx/0x9227f7b00bf2c98a7e16eb5ab90c04df5b49698297ee7f52c765d5218af395ad
b) https://etherscan.io/tx/...
2
votes
0answers
33 views
ethereum-php library SmartContract balanceOf always returns 0
I am trying to check balance of some USDT token using ethereum-php library but it always return 0.
Here is the code,
$contractMeta = json_decode('[{"constant":true,"inputs":[],"name":"name","...
2
votes
0answers
547 views
Transfer ERC20 (usdt) token between two addresses using web3.py
Here is my code:
token_from = "0x0d0707963952f2fba59dd06f2b425ace40b492fe"
token_to = "0x763015f098cf18cfa28baf25653955f271fb63ff"
token_to_private_key = "0x0000000000000000000000000000000"
...
2
votes
2answers
109 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 ...
2
votes
1answer
24 views
can contract check mining of certain transaction in real time?
I want to make logic following
A user send token to B(transaction #1)
contract check in realtime whether transaction #1 is mined or not.
If it is mined, contract goes to next step.
How can I make ...
2
votes
1answer
120 views
Ether in ERC-20 transactions?
I have one contract that I give tokens from a ERC20 contract implemantation. When I call the balanceOf function from the Token conract. Response me that I have x Tokens. Nice !!
But when I try to ...
2
votes
1answer
162 views
Contract that converts ERC20 token into a new ERC223 according to specific exchange rate
I did some research but I couldn't find anything so specific. I would like users that own a specific ERC20 token to be able to use it to buy an ERC223 token generated by a contract according to ...
2
votes
1answer
445 views
Passing one contract instance as an argument to the constructor of another contract
I need to use the functions of the ERC20 contract in another contract.
The ERC20 contract is from the openZeppelin contract library. I found the following code on a website:
import "../../...
2
votes
0answers
68 views
A token transfer enable/disable function works fine in 0.10.0 but not working in Mist 0.11.1
So i have this contract where i have a function to enable/disable transfer of the contract's token.
it works fine in Mist 0.10.0
but when i try to call the disable/enable function, it gives me the ...
2
votes
0answers
29 views
msg.sender is not showing corect value
I am facing a strange issue. Please read the below case craefully and assit me to geth this issue resolved.
I have ERC20Token created by Zeppling templates.
[Please ignore syntaxes, I am just trying ...
2
votes
0answers
172 views
Send ERC20 Tokens from Fixed Supply Token Contract to TokenCrowdSale Contract
For ICO Crowd Sale I have created 2 contracts one is MyToken.sol & other is MyTokenCrowdSale.sol.
MyToken.sol creates fixed supply ERC20 tokens.
contract MyToken is DetailedERC20, StandardToken {
...
2
votes
1answer
620 views
How to add website link to erc20 token on etherscan.io
How can we add this official site link to our deployed contract? Like in the image below:
Here is my deployed contract address: https://etherscan.io/address/0xab73a739729a21b2299761408507556d2719af89#...
2
votes
0answers
122 views
Can a token store funds like an escrow and still meet ERC standards?
In one of my contracts, a user creates an escrow that stores some important information. These escrows are bundled together and passed to another contract, which sends the user tokens. The tokens are ...
2
votes
2answers
920 views
ERC-20 contract from another contract
I am trying to create contract which can access functions of any ERC-20 standard token contract. At first, I'd like to get balance of given address.
I run private testnet using geth, I have deployed ...
2
votes
2answers
1k 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 ...
2
votes
1answer
360 views
Transfer ERC20 token in mainnet with web3js(succeed in ropsten, failed in mainnet)
I want to transfer some ERC20 tokens in ethereum. I did some preparation work and tried in ropsten, it succeed. Then I changed the used api, wallet address, httpProvicer, contract address, and ran the ...
2
votes
1answer
62 views
In the case the Zerofunctionselector bug, how to know which function NAME has a 0 selector?
Normally, If a smart contract is not affected by the Zerofunctionselector bug, then at the end of the code which makes jump to the target function lies a 0xfe opcode (which result in the smart ...
2
votes
0answers
307 views
ICO manage softcap and hardcap when accepting ETH, BTC, or even fiat?
Using a typical capped crowdsale smart contract you can control the contribution so it always stays within the softCap - hardCap range.
When the ICO accepts ETH then it's quite easy. You can just ...
2
votes
3answers
291 views
Given transaction hash, how to proof that it was a successful erc-20 token transfer using web3?
I have a transaction hash and an RPC access to fully synced node. How to check if the token was actually moved? The transaction might be old, so there is no point in querying the contract.
If I ...
2
votes
0answers
302 views
transfer function is not working for the smart contract
Below is the Scenario of the problem: I made some changes in the real concept because it will hard to understand the problem so I try to make it real simple.
I make a contract to facilitate some ...
2
votes
1answer
274 views
If a function calls another contract function that throws, will the initial function throw as well?
If I call a function in another contract that doesn't return a boolean, but has throw() invariant checks, is it safe to assume the function finished properly if the transaction isn't reverted?
I ask ...
2
votes
0answers
1k views
How to transfer ERC20 tokens from a multisig wallet?
How can I transfer ERC20 tokens from a multisig wallet?
According to this question, it is possible to send a token from a multisig by setting the to parameter as the token contract's address and ...
2
votes
0answers
381 views
How can I use Geth to get all tokens on an Ethereum address?
Having an ETH address, how can I programmatically see what tokens are on this address?
Currently I have a list of tokens and a loop that checks balance on the ETH address for each contract address, ...
2
votes
2answers
587 views
Consolidate Batch of ETH Wallets w/ERC20 Tokens?
I have a large number of Ethereum wallets with small amounts of ERC-20 tokens in each. How can I send all of these tokens to a single ethereum wallet without doing this process manually? (it would ...
2
votes
3answers
3k views
How to do an air drop to all ETH token holders?
Say I have an ERC20 token and I want to distribute it 1:1 to all ETH token holders at a given block. Is there a straight forward way to make a smart contract that anyone could call in order to receive ...
2
votes
0answers
263 views
Migrating a token from Counterparty to Ethereum
I am having a token in Counterparty blockchain and I'd like to migrate it over to Ethereum. The token is currently being traded on some of exchanges.
What strategies there are to take here? Are there ...
1
vote
0answers
12 views
API for circulating supply
I am trying to list circulating supply on coingecko for an ERC20 token - how would I go about doing this? I've been able to find one for total supply, but not circulating however.
1
vote
1answer
36 views
Experiencing an “invalid signature error” when trying to use the “permit” feature of ERC20 tokens that support EIP712
I'm currently writing a few smart contracts in solidity and interacting with them through web3. The premise being that a token can be deposited into a pool and can then subsequently withdraw at a ...
1
vote
0answers
10 views
Transfer loan to other wallet
Say I have deposited to the y-pool at curve.fi and staked the corresponding crv tokens at the gauge. Is it possible to transfer that "loan" to another wallet without unstaking?
1
vote
1answer
45 views
ERC20 optimization
I am studying popular Ethereum smartcontract's source code and there is something i do not understand on ERC20 standard.
Let's took this example:
https://github.com/OpenZeppelin/openzeppelin-contracts/...
1
vote
0answers
17 views
How to Accept an ERC-20 token as Payment for a Product?
First of all, this question was asked before here: Accepting ERC-20 Tokens as payment but I want to see if a better way has been developed to accept ERC-20 for payment, so I'm asking again. To ...
1
vote
1answer
25 views
How can I transfer ERC20 Tokens to Bitcoin donor in ICO?
I developed ICO on solidity. As everyone knows smart contracts only accept ETH, but I've seen many ICOs which accept BTC and any other cryptocurrency as well. I want to know how can I handle it if ...
1
vote
1answer
56 views
Error Transaction revert / no balance but Balance is there
contract MyToken is ERC20 {
constructor ()
ERC20("StableToken", "STBL")
public
{
// Mint 100 tokens to msg.sender
// Similar to how
/...
1
vote
1answer
16 views
Send a proportional amount of ETH to every token holder
I am creating a token, of which I can mint an unlimited amount. I will sell them to people.
Then I need to send another token, or ETH, to every holder of my token.
The amount sent should be ...
1
vote
1answer
93 views
Error processing transaction request: already known
I'm developing an application with which you can make ERC20 token transfers. When you make transfers from one account to another with a reasonable time between transfers it works correctly.
But when ...
1
vote
0answers
28 views
How to pass array in web3js(0.20) as function parameter to solidity?
I have a function in solidity which take array as argument and processed that array.
function add_level_income(address[] memory _referredBy, uint256 taxedTokenAmount) public returns(bool) {
...
1
vote
0answers
50 views
What s the fake deposit attack affecting some exchanges with erc20?
There are a lot of articles about hacked tokens affecting centralized exchanges only when Googling fake erc20 deposit but
I failed to find a reference describing how the attack works technically.
The ...