Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
10 views

Error for ERC20 transfer The constructor should be payable if you send value

I have two contract 1) ERC20 contract 2) ERC20 token registry contract which is invoking my token contract and making a transfer function call to the token But function call is ending up with an ...
0
votes
2answers
14 views

How to restrict ICO investors to redeem their ERC20 tokens while not restricting them to trade tokens among themselves?

We want to create an ICO where investors can purchase ERC20 tokens anytime but have to wait for atleast 3 months from the date of purchase in order to redeem/encash them on our platform. But we do ...
0
votes
1answer
14 views

How to send ERC20 Token?

I try to send Token based on Erc20. and I can send Ether and something function but i dont know how to use transfer function in javascript like that. function transfer(address _to, uint256 _value) ...
1
vote
1answer
22 views

Why gas price so high in erc20 tx?

I know normal gas price is 1gwei(https://etherscan.io/tx/0x4b0aaea87288a1080288187d99c666749577801014535f879d5d85719866ddeb). But why transaction in erc20 is 6gwei or 30gwei (https://etherscan.io/tx/...
1
vote
2answers
23 views

Token with whitelisting on crypto exchange

we are planing to implement a ERC-20 token with whitelisting (only whitelisted addressees, can trade tokens). And we are planing to list this token on some exchanges. Is this possible? What must be ...
1
vote
2answers
12 views

Why isn't this a vulnerability in openzeppelin's ERC-20 implementation (no allowance check)

openzeppelin's implementation of and ERC-20 token is as follows: function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(...
0
votes
2answers
14 views

Create token exchange by defining decimal values

I just learnt a lot about solidity and decided to put it into practice. Something I truly don't understand is how I can bypass the limitations of this programming language. Assume the following ...
1
vote
0answers
27 views

Pre-Sale receives error: Canceled - Warning! Error encountered during contract execution [execution reverted]

I have 2 contracts The first one cretes a token contract The second creates pre-sale contract Pre-sale contract created with 0.5 eth for paying for gas When trying to send 0.5 ethereum to pre-sale ...
0
votes
2answers
18 views

Compilation error in ethereum wallet

I am trying to compile the example contract in https://ethereum.org/token and following along with the instructions. The Ethereum wallet cannot compile it though. I get the following error message ...
0
votes
1answer
23 views

How should one approach the signing of ERC20 token transactions with an offline device?

I use an offline PC as a cold wallet. It works in combination with 2 USB drives: the 1st has Tails OS; the 2nd has my key files, a copy of MyCrypto desktop, and my encrypted account info. I can sign ...
1
vote
1answer
22 views

Why are ERC 20 transfer(…) gas costs different?

We have 2 identical transactions, one spends 22409, and the other 37345 gas, why so? https://etherscan.io/tx/0xaeefbb8aab4fd61fc057b4013f8ca2accd4ed573ec4dcfacc02a1bcfb99cb3f8 https://etherscan.io/...
1
vote
1answer
75 views

Solidity 0.5.2 - OpenZeppelin - New SafeERC20 callOptionalReturn(token,data)

i've been trying to mix ERC20 functionality with ERC223 function overloading technique and create a bridge for backwards compatibility using SafeERC20. For relevancy sake i renamed SafeERC20 into ...
0
votes
0answers
25 views

ERC20 token transfer transaction reverted

I'm trying to transfer token using ERC20 token transfer method using web3.js (version: 1.0.0-beta.37). I could successfully transfer tokens with Remix as the method is working fine. However, I got the ...
0
votes
1answer
24 views

In ICOs why initial supply/total supply tokens are transferred to owner address rather than storing it in the contract itself?

Here I have taken two of the top 20 ERC20 Token/ICO. 1.BNB(https://etherscan.io/address/0xB8c77482e45F1F44dE1745F52C74426C631bDD52#code) 2.BAT(https://etherscan.io/address/...
0
votes
1answer
29 views

Storing ICO tokens in contract address instead of owner address

In most of the ICOs,initially all tokens are transferred to owner address instead of being handled at the contract address.Why?.
0
votes
1answer
21 views

Transfer from contract address to another address

I created ERC-20 token, and send other ERC-20 token to created contract address. Can I transfer that token?
0
votes
1answer
18 views

Looking for updated and stable standard ERC-20 smart contract template which will pass through Remix compilation (latest version) without errors

I am looking for an updated and stable standard ERC-20 smart contract template which will pass through Remix compilation (latest version) without errors. The template should preferably be easy to ...
1
vote
3answers
42 views

Is the burnFrom function in erc20 token contract unsafe?

We have been issuing a token using a basic erc20 token contract from https://ethereum.org/token An exchange that we wanted to list our token, asked for a collateral as they see the burnFrom() function ...
0
votes
1answer
19 views

How to send tokens to a address with a specific contract? [closed]

I want to send tokens from my wallet to a crypto-currency exchange website wallet with a specific contract used by the crypto currency exchange website. For example- I want to send token to this ...
-1
votes
0answers
11 views

Can I exchange between tokens from crowdsale? If it can, what ERC can use for exchange?

I running B2B Loyalty model in my corporation. Each company have its token and can exchange with other company. So that, I needs some feature from ERC and Crowdsale to allow exchange tokens.
0
votes
1answer
24 views

ERC20 exchange support [closed]

how can you add support for erc20 tokens on your own exchange, so that users can perform transactions between themselves? There are many services that make it possible to work with BTC and ETH, but ...
0
votes
1answer
37 views

Set Price for ERC20 Token [closed]

I have an ERC20 Token that i have deployed and now have transferred it to about 100 addresses. Now the price shown on my Etherscan for my token is $0.00. When i search through the top ERC20token like ...
0
votes
1answer
21 views

buytoken function with erc20 interface

I was following a tutorial that can buy erc20 tokens and I'm now stuck with transferring tokens to a buyer account which I need more clarification. So basically, a buyer account is trying to purchase ...
0
votes
1answer
26 views

Difference between ERC20 and ERC223

i still don't get the idea behind the "if you send 100 ERC20 to a contract, they're stuck there and these 100 ERC20 are lost forever".. i really don't get.. like, a contract has an address and a ...
0
votes
1answer
28 views

Possible for a ERC-20 contract owner to freeze tokens?

Is it possible for the contract owner of a ERC-20 token contract to freeze tokens in a third party’s ethereum address? Sounds stupid, but our project member decided to send a small amount of tokens ...
2
votes
1answer
31 views

Update Solidity - 0.5.4 (ERC20 + ERC677)

I'm trying to create an ERC20 Token that can send Tokens to a Receiver Contract similar to how ERC223 does and i decided to try ERC677 but i can't understand how to update this code to match Solidity ...
0
votes
0answers
22 views

ETH send to contract fails, probably fallback() function fails to call

I deployed the following piece of contract on testnet and everything works fine.But, when I send test ETH for the contract address, transaction fails. I tried with higher gas as well but failed as ...
1
vote
2answers
18 views

Verify transfered amount of two transactions from same ERC20 to same Contract

I making a contract to sell stuff in a decentralized way and want to use following method to transfer founds. function transferToken(address token, address from, uint256 amount) internal { IERC20 ...
0
votes
1answer
36 views

Out of gas error while receiving tokens

I have an issue: I want to receive some BOKKY tokens to test it. When I use simple wallets I just send ethers and receive tokens, everything works fine. I also have my own smart contract (multisig ...
3
votes
1answer
31 views

Embedding ETH Wallet Address into Webpage

Hey is there a quick way to embed an Ethereum wallet address and a button into my existing website so as to allow people to send in their ETH donations to me? Or do I need to go through the whole npm ...
0
votes
0answers
21 views

How to flush token to another contract from token holder's token balance from ERC-20 contract?

I have to implement the following scenario: - One ERC-20 token contract. - Another contract which will flush tokens of ERC-20 tokens. - Add these tokens to one, defined Admin address. Note: All ...
-1
votes
1answer
20 views

How can a company be benefited using utility tokens? [closed]

Are there any profits for a company having ERC 20 tokens, if the token price gets hiked?
1
vote
2answers
31 views

How to convert smallest unit of ERC20 with less than 18 decimals to full coins without rounding errors?

I can just use web3's fromWei function for all token that have 18 decimal places but I'm not sure how to convert token to full token without having to worry about rounding errors. For example convert ...
0
votes
0answers
15 views

ERC-20 TransferFrom function exceeds GasLimit calling from other conract

I have the following error. Imagine that I have contract A, B(ERC20 implementation contract), C, D and E. They are inherit in that order. Testing the functionallity works fine in remix. But when I try ...
0
votes
1answer
19 views

Is there a good erc20 source using web3js?

I'm looking for some source codes using web3js for interaction with erc20 tokens and contracts. Does anyone know good source codes using web3js? Thanks in advance!
1
vote
1answer
40 views

ERC 20 or ERC 721 for my dapp?

I am currently making a game where you collect gear pieces and upgrade them. There will not be a 1-1 upgrade, but rather 3-1, meaning 3 items may or may not upgrade to 1. I am aware of the difference ...
0
votes
1answer
26 views

How to get total values in mapping and details of each transaction

I am trying to write a simple contract contract students{ uint public totalTokens; constructor() public { totalTokens = 800; } struct Students{ uint amount; string givenFor; } mapping (...
0
votes
0answers
34 views

Multisignature wallet for ERC20 tokens

I am developing my own multi sig wallet, however I am new here, so I don't have good understanding of how does the exchange ERC20 <=> ETH work 1. How to get BNB coins? As I understand, for ...
0
votes
1answer
23 views

how can we set auto transfer of my tokens to the wallet which transferred me ethers

Okay so I have deployed my contract to network, and my wallet or account via which I deployed it contains all my tokens of the newly created contract. I dont want to list my token anywhere since since ...
1
vote
1answer
26 views

Etherscan API no decimals separator

I am using Etherscan API to retrieve certain erc20 token balance on given ETH address and get a number like 62910000000 without decimals separator. In fact the proper balance is 6291000.0000. How to ...
1
vote
1answer
39 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 ...
1
vote
1answer
51 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 ...
0
votes
0answers
12 views

Can I send an ERC-20 token to my users even if though I have 0 ETH?

Let's say I have USDC erc-20 token and I want to send it to my user's ETH address. But I have 0 Eth. Can I send it? If not, what methods are there to bypass that requirement of having to always have ...
0
votes
1answer
39 views

VM error: invalid opcode while trying to execute buy function on Remix IDE

I am using following code for custom token on ethereum. pragma solidity >=0.4.22 <0.6.0; contract owned { address public owner; constructor() public { owner = msg.sender; }...
0
votes
1answer
23 views

Is it possible to have ERC20 token (A) own other ERC20 tokens (X, Y, Z)

I'm building a DAPP, where a user has one 'parent' ERC20 token and several other 'child' ERC20 tokens. So what I want is .... To have a parent token A, and that token owns the tokens X, Y and Z. In ...
0
votes
0answers
43 views

Revert on ERC20.transferFrom

I am getting Error: Returned error: VM Exception while processing transaction: revert when testing MyContract.deposit() Here are simplified versions of my code to highlight where the issue is ...
0
votes
1answer
37 views

Can use smart contract as payment gateway [closed]

Most suggest that cannot use ERC20 token as payment gateway integration .Why?
0
votes
1answer
34 views

How to use 2 different constructors with open-zeppelin

I don't understand well how to implement an smart contract to create a capped Token. If I want to follow the example of a simple token is easy: https://github.com/OpenZeppelin/openzeppelin-solidity/...
0
votes
0answers
31 views

ERC20 token transfer with a multisignature wallet

I have a multisignature wallet(it is a different contract). I have some tokens to transfer to another address(token is an ERC20 and can transfer via (yourContract.methods.transfer(toAddress, amount)) ...
0
votes
1answer
27 views

Can i call transfer function in other contract?

can i call ERC20 token's transfer function in other contract? like transfer AToken from using BContract's function can I?