Hot answers tagged

3

No, you can mint as many as you want, which will increase the total-supply (up to 2 ** 256 - 1). Make sure that the contract has a mint function; it is not a part of the ERC20 standard as far as I remember. You can add this function (or any other function for that matter), so long as you implement the standard itself.


2

If you are creating an ERC20 token, I suggest you look at inheriting from the OpenZeppelin Contracts ERC20 implementation. See the documentation for details to see if it meets your needs: https://docs.openzeppelin.com/contracts/2.x/tokens The total supply should match the supply of tokens. If the token allows minting, then when minted the total supply ...


2

BN stands for Big number. you can have the meaning of all these fields in the the BN.js library documentation as this later is used by web3js (1.0.) to deal with big numbers. EXP : negative for bit sign red for reduction


2

The target contract is a non standard ERC20 token. It should have three topics, two indexed parameters and the event id and the transfer value in the data field. But it has four topics instead. "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000c5ec6937d3278311e2ace517df214717310c0820", "...


1

You misunderstood the flow. You have User => Escrow.deposit() 1. Escrow => token.approve(this, amount) 2. Escrow => token.transferFrom(msg.sender, amount); // msg.sender did not approve this That won't work for the same reason I (for example) can't approve myself to withdraw your funds and then do it. It has to go: User => token....


1

First, it can be difficult to achieve one-to-one product-token mapping as ERC20 is standard for non-unique tokens. Have you tried ERC-721 standard? http://erc721.org/ But if you want to stick to ERC20, I guess you want something like this (sorry if there are some minor typos, I typed it in the website's text box) Token.sol ... //place to store privileged ...


1

0x Instant doesn't have Ropsten testnet tokens as a default. Only Mainnet and Kovan. You can add additional asset data to Instant in these cases: zeroExInstant.render({ orderSource: RELAYER_URL, availableAssetDatas: ['0xf47261b0000000000000000000000000744d70fdbe2bc4cf95131626614a1764df805b9e'], additionalAssetMetaDataMap: { '...


1

A contract cannot change its address. Token contracts are not an exception. In practice, a token author may issue a new contract. In such a case, it is always a migration from the old contract to the new, so you have two contracts - the old token and the new token. You could treat those as separate assets because technically that's what they are. Some ...


1

you can instead use a factory class which creates token as follows in this design subtoken is an abstract class, implemented by token class and in the end a factory class which will create different instances of token class. pragma solidity ^0.5.0; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; ...


1

In ShouldIMakeMyselfEligible you are performing checks against msg.sender, which is used to access the calling address in a transaction. However, this function is marked as view and so is accessed via a call rather than a transaction. msg.sender likely does not contain the data you expect it to. You specify that an address should be given as an input to ...


Only top voted, non community-wiki answers of a minimum length are eligible