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.

Filter by
Sorted by
Tagged with
0
votes
0answers
2 views

create ERC-20 token from a contract function

I would like to do a function create contract with ERC-20 interface. But I have a few problems. If anyone help me I’ll be appreciated. Here’s the code : pragma solidity ^0.5.0; library SafeMath {...
0
votes
1answer
9 views

How to request tokens from msg.sender within contract function

transferring ethereum from the user of your smart contract is simple enough, you simply use msg.value and can use this within your contract's functions. But doing the same thing with tokens is a bit ...
0
votes
0answers
16 views

Why do I get a bad instruction in the transaction?

Here is my withdraw dividend code : function WithdrawDividend(address) public { if (!_RestrictedFromDividend[address(msg.sender)]) { _SavedDividend[msg.sender] = _balances[address(...
0
votes
1answer
25 views

I don't understand why my function is not working

I have a read function to check whether someone should go and use the write MakeEligible function. Here is the code: function ShouldIMakeMyselfEligible(address) public view returns (bool) { if (...
0
votes
1answer
27 views

Mapping not updating after function is called

After calling this function: function WithdrawDividend(uint256 value) public { require(value <= _balances[msg.sender]); if (_RestrictedFromDividend[address(msg.sender)] <= 0) { ...
1
vote
2answers
37 views

Mapping not updating?

Here is the function in question : function WithdrawDividend(address, uint256 value) public { require(value <= _balances[msg.sender]); if (!RestrictedFromDividend[msg.sender]) { ...
0
votes
0answers
16 views

Why is my code calculating incorrectly?

My code to calculate the dividend someone is owed is as such : function ViewDividendOwed(address) public view returns (uint256) { if (!RestrictedFromDividend[msg.sender]) { return ...
1
vote
1answer
16 views

Why is the holder balance more than total supply? Why has nothing been sent to the contract?

My token is constructed with 100,000,000 supply. Each transaction, 0.007% is burned and a further 0.003% is sent to the contract, making it part of the dividend pool. Here is the transfer function : ...
0
votes
1answer
17 views

How do I change where a function appears in etherscan?

I have two functions which are in places I don't want them to be. The first is a readme function, which simply returns a string for people to read. I put it at the top of my code, and I hoped it ...
1
vote
1answer
29 views

How can I apply an effect to an address for a set time?

I am using a dividend pool system for my token. Currently, when a user withdraws their dividends they have this line of code is run: emit Transfer(address(this), msg.sender, DividendstoDividend); ...
0
votes
1answer
24 views

If I create an ERC-20 token and accept dollars from people in exchange of my ERC-20 token, would this be an asset-backed token?

If I create an ERC-20 token and accept dollars from people in exchange of my ERC-20 token (with 1 token per dollar), would this be an asset-backed token or a security token? The idea is to create an ...
0
votes
2answers
15 views

Mappings can not be assigned to error

I am trying to create a dividend function for my token. This is in the first part of the contract for my coin: mapping (address => uint256) private _SavedDividend; Here is the constructor code: ...
0
votes
2answers
37 views

How do I send part of a transaction to all token holders?

Here is the code for someone performing a transfer of my token function transfer(address to, uint256 value) public returns (bool) { require(value <= _balances[msg.sender]); require(to != ...
0
votes
2answers
38 views

How to set and get marketprice of token in contract?

I am building a simple erc-20 token. I don't have an idea as how token price is setup. However, I need to get my token's market price inside another contract. If you see this example of token BOMB, it ...
0
votes
3answers
23 views

Why are contacts from Remix editor and explorer different after deploying?

I try to deploy my ERC20 token. My steps are: 1) I created a contact with Remix (by some manual) https://gist.github.com/pistol88/a934da7fcaa93a92f4c4de60df56a0cf contract TestToken is ERC20Standard ...
0
votes
1answer
47 views

error: VM Exception while processing transaction: revert SafeMath: subtraction overflow on migrating crowdsale conract

I am developing the token sale Dapp using openzepplin-solidity version 2.3. While migrating, I got the following error. Returned error: VM Exception while processing transaction: revert SafeMath:...
0
votes
0answers
17 views

How to attach a Logo to an ERC20 Token

I have created an ERC20 Token with MEW. However, when I send it to people who have different ERC20 wallets, the logo of my token is always Ethereum like How do I put my own logo on the token so that ...
2
votes
1answer
72 views

0x0000000000000000000000000000000000000000 address behaviour

I have a question about the possibly strange behaviours of address: 0x0000000000000000000000000000000000000000 We know that: ETH + ERC20 tokens sent there are burnt Upon creation of a new smart ...
0
votes
2answers
95 views

File import callback not supported import “./IERC20.sol”;

when I try to compile my contract I see errors like this : DemirelToken.sol https://eksiup.com/p/4z49413damc3 here's the code : pragma solidity ^0.5.0; import "node_modules/openzeppelin-...
1
vote
1answer
44 views

Sending Tether USDT via RPC JSON API call

I'm trying to send Tether using JSON RPC API via 0xdac17f958d2ee523a2206206994597c13d831ec7 contract. I've tried to cases: From simple ETH wallet From ETH wallet, which has only USDT This is what ...
0
votes
1answer
23 views

Create multiple tokens for a unique property

here is the idea: we assign a set of unique tokens to a company and then we allow people to buy some tokens and get partial ownership of that company. How can I achieve this? I was thinking of ...
0
votes
0answers
31 views

Accept different tokens for one specific token within the contract

Assuming I want to accept different (let's say 3 or 4) tokens on exchange one specific token (MyToken). Let's call this X transfer. I'm thinking to write ERC223 contract which will accept different ...
0
votes
3answers
51 views

how to calculate 1% of erc20 18 decimal token?

I am building a system that should calculate the 1% of the tokens sent to it. I am thinking that it is ok to deal with large numbers but when it comes to smaller numbers like 1 token or 2 token [not ...
3
votes
1answer
82 views

What is the standard for listening to ERC20 events?

Hi I am a bit confused here. The official EIP documentation states that event Transfer(address indexed _from, address indexed _to, uint256 _value) is how the Transfer event should look like. If I ...
0
votes
1answer
29 views

Wrong estimation of gas while contract deployment

I have a smart contract: pragma solidity 0.5.3; import "./ERC20.sol"; contract Transfer { ERC20 private erc20iface; address private _owner; modifier validOwner() { require(msg.sender == ...
0
votes
1answer
12 views

Measuring elapsed time between user erc20 token transfers with lazy evalutation

So I'm learning solidity and wanted to make an erc-20 token after reading the solidity by example docs. Let's call the token T. I would like to measure the elapsed time between two transfers of an ...
0
votes
1answer
20 views

Is Smart Contract of any ERC20 token is always available publicly

Is Smart Contract of any ERC20 token is always available publicly. If not complete, then what things are generally available,(for eg, except some sensitive information) And, if not any of them are ...
0
votes
0answers
18 views

storing ERC20 inside of Non-fungible tokens?

Is it possible to store value in the form of ERC-20 tokens inside of non-fungible tokens such as ERC-721? If so, could someone showcase how through an example?
1
vote
1answer
17 views

Is there a token standard that allow for future minting and burning of tokens?

I am interested in an ethereum token with the functionality for an operator to mint new supply at any time. It would also be nice if the operator could burn supply explicitly rather than sending to an ...
1
vote
2answers
23 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
44 views

What is the current distribution of ERC Token Standards in the top 100-1000 most active token contracts?

From ERC 677 Motivation ERC20 requires a multistep process for tokens to be transferred to a contract. First approvemust be called on the token contract, enabling the contract to withdraw the ...
1
vote
0answers
18 views

What do I do to deploy my ERC 20 token [closed]

I have a ERC 20 token platform the token: BTZ botztoken and what I am wanting to do is figure out what I can do with the tokens as utility tokens to accomplish teams mission which is: to help ...
0
votes
1answer
35 views

ERC20, how to calculate how many tokens for crowdsale?

If you look at this article, the total tokens for crowdsale is 100 tokens and defined in the code as uint256 public maxTokens = 100000000000000000000; how come 100000000000000000000 becomes 100 ...
0
votes
1answer
30 views

Code A Contract To Accept A Different Token (Other Than ETH)

I'm developing a DApp for Decentraland that will accept payments in their ERC-20 token MANA. How can I code a smart contract to accept a token other than Eth? How can msg.value know the value of a ...
0
votes
1answer
19 views

Function to transfer tokens to a second address with fixed percentage

I'm trying to code a transfer function that automatically sends tokens to a second address taking a specific percentage from the original sent value. What I wrote: address public _ExtAddress; ...
3
votes
1answer
63 views

How to pay gas fee for new addresses of ERC20 tokens that initially have 0 Eth balance? [duplicate]

I have a confusion, When we create new address/account for an ERC20 token then it have 0 Eth balance. When we send some tokens to this address and then withdraw token again from this address require a ...
0
votes
1answer
27 views

How can I wait if it's not possible in smart contracts? [duplicate]

From my understanding, waiting in a solidity smart contract would create a total disaster for the whole Ethereum's blockchain. I can see in some circumstances that solidity offers block.timestamp ...
1
vote
1answer
59 views

Updating ERC20 Contract from 0.4.0 to 0.6.0

Im updating some ERC20 contact code from solidity 0.4.0 to 0.6.0 and hitting some snags as it seems openzeppeling has changed its structure since then as can be expected. I cant access the balances ...
0
votes
1answer
33 views

Create custom mobile wallet for my two ERC20 Tokens

I have two ERC20 tokens that I created on Ethereum. I would like to know if it is possible for me to create a mobile application that will allow my users to check their balance (for tokens) and ...
0
votes
1answer
25 views

ERC20 finishMinting() after ICO

When ICO is finalized, I call finishMinting() to prevent from adding new tokens to totalSupply. contract MyTokenCrowdsale is Crowdsale, MintedCrowdsale, CappedCrowdsale, TimedCrowdsale, ...
0
votes
2answers
59 views

Help with ERC20 Contract

I sent tokens to my contract address instead of to my myetherwallet address from an address that the tokens were previously sent some time ago. Now I have no access to the amount sent to this address. ...
0
votes
1answer
17 views

If contract imports erc20 token contract, can I use functions in token contract without call or delegatecall? [closed]

I thought it is required to call token contract's functions to use transfer or transferfrom when I define new contract. But if the contract inherits or imports token contract, then call is not ...
1
vote
1answer
25 views

ERC20 RefundableCrowdsale

I have a crowdsale contract that inherits RefundableCrowdsale.sol from OpenZeppelin. I was using their v1.10.0 initially, but now revamping it using v1.12.0. contract TestTokenCrowdsale is Crowdsale,...
2
votes
1answer
34 views

How are people using ERC20 to tokenize assets

Hey guys been looking a lot into tokenization of assets wondering how this is possible with ERC20 (Seeing a lot of people use it and keen to understand) how would you represent an asset with each ...
0
votes
1answer
15 views

Is it possible to seperate token payer from service-consumer with special contract?

In general, token-payer(=msg.sender) receive service from smartcontract. Is it possible to seperate token payer from service-consumer with special contract and general smartcontract above? It means ...
0
votes
1answer
28 views

can this smartcontract work?

Here are smartcontract A and B B has BuyService function. User need to call this function to get service. A has token(erc20) enough. If user call A without tokens, then A call B and pay tokens on ...
0
votes
0answers
8 views

Is it possible to give service paid already to another user as a gift regardless of dapp' logic or smartcontract?

Is it possible to give service paid already to another user as a gift regardless of dapp' logic and smartcontract? Lets suppose here are user A,B and dapp's smartcontract C A purchase service via C. ...
0
votes
1answer
16 views

Launch ERC20 token [duplicate]

I have implemented the ERC20 interface and the token is ready. Next step is to list it on an exchange like kraken. What is the process ? What determines the initial value of a custom token ? What will ...
0
votes
0answers
19 views

DeclarationError: Undeclared Identifier. Did you mean “_data”? data = _data ^__^. All i want is to create a cryptocurrency

pragma solidity ^0.5.1; contract owner { address public owner; function owned() public { owner = msg.sender; } function set( string memory _data) public { data = ...
0
votes
0answers
14 views

Execute `transferFrom` after executing `approve` on erc20

I can not withdraw from adress specified by approve. truffle(development)> erc20.approve("0x9e26730bf972d6ae8840b8f6003a61f57e25ff92", 1).then(b=>res=b) { tx: '...