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

how do most of contracts sell service(or items) to user usually?

how most contract sell service to user usually? I think there could be 2 ways 1. user just tap buy button to call buy function in dapp contract then contract does itself 2. when user tap buy button, ...
1
vote
1answer
5 views

When I tap buy button in market how does wallet check my allowance instantly?

On CrytpoKitties, when I tap the buy button in a market, MetaMask comes up and shows if I can buy or not based on allowance instantly. How is this possible? Is it making query? Is it included in kitty'...
1
vote
1answer
9 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 ...
1
vote
1answer
4 views

Do dapps(contract) check allowance of buyer when he calls buy function?

When a buyer calls a buy function on dapp contract, some dapps check the buyer's allowance before transfer tokens(erc20). Is it usual?
0
votes
3answers
34 views

Remix: This contract does not implement all functions and thus cannot be created

I'm new here and code with openzeppelin framework 2.2.0. There is no error occurred when compiling with solidity 0.5.8. But when I'm going to deploy the contract, I have no bytecode and cannot ...
0
votes
1answer
23 views

Smart contract architecture [on hold]

I want to write the smart contract architecture for a new smart contract on Ethereum ERC20, how can I do that, and what does it mean smart contract architecture.
0
votes
1answer
21 views

can A call approve B to spend token though A have no tokens in his account?

can A call approve B to spend token though A have no tokens in his account? does function approve require to check balance of A?
0
votes
1answer
10 views

If i pay some service on certain dapp, does this tx can be reverted because of confirmation?

I paid and got service from dapp. does dapp wait until enough confirmation is settled? or not, is it possible that tx can be reverted?
0
votes
1answer
14 views

Can I make a ERC20 transer after receiving and before N confirmations?

Let's suppouse A user send tokens to B user. It may be hard to consider it to be confirmed yet. At this point B send the tokens received to another address. Could this transaction be successful? Is ...
0
votes
1answer
24 views

Ropsten Test Network

I have created a test token and deployed it on the ropsten test network. I have the full balance in my ether wallet. My question is how can I transfer this token to other wallets? How can I configure ...
1
vote
1answer
32 views

TX fails in private blockchain when trying to access an ERC20 contract from another contract

I have an ERC20 contract and I am trying to access it from another contract, which is a Faucet. In the Faucet I have a function to query an account's balance, and another one to transfer some tokens ...
1
vote
1answer
24 views

ERC20 token balance is always zero

I'm writing a pre-minted ERC20 token contract derived from openzeppelin-solidity like: pragma solidity >=0.4.24; import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; ...
1
vote
0answers
20 views

ERC20 Token support for metamask website payment

I have the following code working in my site to accept ethereum payments in my website via metamask.... <!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/...
1
vote
0answers
12 views

There were reports of certain countries that had issued their own cryptocurrency. What are they?

I've been reading that certain countries with sanctions has issued their own cryptocurrency on the Ethereum blockchain as ERC20 tokens. What are they and which countries? And are they on any exchanges?...
0
votes
0answers
7 views

Is it possible contract suggest certain User(EOA) to do some transaction?

I send a transaction to contract, then it tells(or suggest) certain user to do something like calling function in another contract. although, user may reject this suggestion, is it make sense in erc20?...
0
votes
1answer
15 views

Does ERC-20 balanceOf function cost no gas?

Given that this is a sample balanceOf function code: function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } and this function is view function,...
0
votes
1answer
9 views

linking the CoreContract and the ERC20 token contract

What is the standard way of making the link between our CoreContract and the ERC20Token contract used by the Core Contract? Are people used to use inheritance like: MyCoreContract is MyERC20Contract { ...
2
votes
2answers
27 views

USD Coin Balance Check By Web3

Now I am getting trouble on checking the USDC balance in my wallet address using web3. USDC is also said that it is ERC20 token, but when I checked the token contract ...
0
votes
1answer
17 views

Staking of coins

I have a question on staking of coins. Suppose there are 10000 tokens in a user wallet, and he wants to put 5000 tokens on staking for a certain time period (i.e That 5000 tokens should go to an ...
0
votes
1answer
21 views

Publish a ERC-20 based token in a private chain [closed]

What are the steps to follow if I want to publish a Togen generated token. Into a exchange platform. The goal is something realted to be able to buy my own token with real money, using a platform like ...
0
votes
1answer
33 views

Can't send ETH to ERC20 contract [closed]

I have ERC20 contract pragma solidity ^0.5.7; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal ...
0
votes
1answer
10 views

Why contract owner balance 1Token instead of 1000000 in Metamask

I made contract ERC20 token MTCZx https://ropsten.etherscan.io/address/0xf9471198b6f9c364f41Ea66e9a3F8daA637Ee77C#code which can sell MTCZx tokens for ETH. When I deployed it I make query to ...
0
votes
1answer
19 views

Question regarding approval of the token

I am trying to make a smart contract where calling a function named transferERC20, you can deposit your erc20 tokens into the smart contract. Here is the code at the moment: pragma solidity ^0.5.0; ...
0
votes
1answer
18 views

Is it possible to give away ownership to another user regardless of dApp UI?

A user purchased service from certain dApp. Although the dApp does not support any function (or UI) to transfer service purchased between users, is it possible that user give it (ownership) away to ...
1
vote
1answer
32 views

Why transaction to ERC20 token smart contract causes error?

I pushed this contract https://ropsten.etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2#code I want to issue test ERC20 token. But when I try to send ETH to my contract I see error. ...
1
vote
2answers
36 views

How can we detect if tokens are transferred to our smart contract and avoid “allow”?

Imagine you have a smart contract that accepts all forms of ERC20s. You want users to call a function by which they will send you their ERC20s and in exchange receive a greeting. Technically we can ...
0
votes
1answer
25 views

I call buy function but another user pay token on behalf of me

Please help me make following process feasible situation: A user wants to buy service(or product) at certain dapp but A has no token(even ETH) in his account so asks B for paying on behalf of. B ...
1
vote
1answer
28 views

How does contract of dapp figure out who buyer is?

How does contract of dapp(eg. market place) figure out who buyer is? If buyer wants to purchase servive(or product) at certain dapp, he should transfer tokens to contract address of the dapp. At ...
1
vote
1answer
37 views

transfer ERC20 Tokens by web3

I'm a beginner of ethereum. I have seen some solutions. I can use sendRawTransaction to transfer costumed tokens from one account to another account. But my boss asked me to use ERC-20 "transfer" ...
0
votes
3answers
23 views

Is it possible to transfer ETH(not erc20) by approve+transferfrom?

Is it possible to transfer ETH(not erc20) by approve+transferfrom? Im so confused about it. Does ETH support itself all erc20 standard functions?
1
vote
2answers
31 views

Is it possible to make approve and transferfrom in single transaction?

I know that owner should call approve in advance then allowed spender call transferfrom to make transaction. We need two steps(tx). Iam curious is it possible to make it by single tx! single step.
0
votes
1answer
7 views

Setting ERC-20 token price

I'm currently trying to set the token price of my ERC-20 token.The problem I'm having is trying to set the price to ETH(0.01) per token, but the closest value I keep getting to is ETH(0.001) per token ...
2
votes
1answer
59 views

How to interact with ERC20 interface?

My target is to send from the ERC20Wrapper.sol deployed contract BAT tokens to my hard coded address. I've created ERC20 Interface: pragma solidity 0.4.18; interface ERC20 { function ...
0
votes
0answers
14 views

How do I send 0.1 tokens from the Parity client to another address using a custom gas price and CLI only?

How do I send 0.1 tokens from the Parity client to another address using a custom gas price and CLI only? Hi, I want to send 0.1 tokens from my Parity client running on Ubuntu to another address. I ...
0
votes
1answer
33 views

How to automatically pre generate thousands of ETH addresses for my app users

I'm building an app where every user will have app-generated ETH Wallet to do transactions with internal ERC20 Tokens. I would like to pre-generate wallets for my users, and assign every wallet upon ...
0
votes
1answer
25 views

Erc20 token smart contract fallback function is disabled, how can I enable it? [closed]

There is a payable fallback function available now on my smart contract, but I want to function it like if someone send 0.01 / 0.05 / 0.10 / 0.50 / 1 ETH and the contract will automatically send the ...
0
votes
1answer
39 views

DAPP WALLET transaction always fails

To improve my skills in solidity I'm working on a "wallet dapp". Based on smart contracts only, users can send ERC20 to another wallet. It works like that: user gives the following parameters: ...
1
vote
1answer
16 views

Is it possible to find a specific statistic for each token?

I'm trying to create some sort of statistic generator related to ERC20s. Let's assume you have 10,000 Token A. I would like to tell users something like: "better than 0.5% of the accounts". Basically ...
0
votes
0answers
28 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
20 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
25 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
25 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
31 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
16 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
29 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
27 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
26 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
142 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 ...