Hot answers tagged

5

Per the ERC20 standard, newly created ERC20 tokens are sent from 0x0000000000000000000000000000000000000000 to the address they are meant to be sent to. It was done as a way of logging and to avoid creating tokens out of nothing. Update The ERC20 standard does not actually define that the tokens are sent from 0x0000000000000000000000000000000000000000. ...


4

The ERC721 Metadata standard does not enforce uniqueness of the returned tokenURI. It is allowable for two 721 tokens to return the same metadata. Whether this is appropriate is up to you to decide as you implement the 721 contract. Most likely in the code you run during the minting process you will assign the metadata and decide whether or not you want to ...


4

As totalSupply variable in ERC20 is an uint256 type it can hold the largest value 2^256-1 whose value is 115792089237316195423570985008687907853269984665640564039457584007913129639935


4

Try this: contract('erc20 deployed', function(accounts) { const REVERT = "VM Exception while processing transaction: revert"; it("should not transfer 1 token from address[0] to address[1]", async function() { try { await erc20Instance.transfer(accounts[1], 1); throw null; } catch (error) { ...


4

Etherscan will recognize your contract once it will log its first Transfer event. This is how it works. Though, even before the first Transfer event was logged, you may view your contract in token tracker: https://rinkeby.etherscan.io/tokens?q=0x5238fFeAEdfc9481bd635B6E0e5eF3b05b19762a


4

The output you receive is in hex format. You need to conver hex to an int. Here is the full code you need to use: const contractInstance = web3.eth.contract(contractAbi).at(contractAddress); const total_supply = parseInt(contractInstance.totalSupply.getData()); console.log(total_supply); I added parseInt() to convert your hex number into a human readable ...


3

This is possible with ERC721 tokens and is built into to spec itself in the form if metadata. You cannot do this with ERC20 tokens, as there is no way to differentiate between individual tokens during a transaction.


3

Serenity wont be a hardfork persay. It'll be a new network deployed with a link back to the existing mainnet, so the current mainnet as we know it will continue exist and all the tokens that exist on it will continue as they are. None of it will be replicated on the new beacon chain or any of the other shards. The current mainnet will essentially become a ...


3

Yes, you can do it. It will be too involved to show a complete implementation, so I will just assume you know your way around an ERC20 contract. Generally, when an ERC20 is deployed, the initial supply is "minted" to the deployer. The next step is to transfer some tokens to a time-lock contract. The time-lock contract can simply hold balances for specific ...


3

Tokens and Ether are not interchangeable in functionality. Ether is a fundamental part of the Ethereum network. It is used to fund gas, which is literally the gasoline of the network. Users pay transactions fees in Ether, Miners get rewards in Ether, and Ether is managed as a part of the underlying Ethereum core blockchain. On the other hand, tokens are ...


3

This sounds like a perfect use case for the now finalized ERC-1155 token standard, which allows one to manage any number of fungible and non fungible tokens in a single contract.


3

Since you do not have control over the address, the tokens have been lost. If your contract does not have a burn function, unfortunately you can not update it. Perhaps what can be done is to create a new contract that copies the current contract state and includes the burn function, but I do not know if this is so simple for your case.


3

If you're referring to Wrapped BTC (WBTC), it has nothing to do with the Bitcoin Network. 1 WBTC is equal to 1 BTC purely through a custodial pegging system. To mint a WBTC ERC-20 token, you must lock-up a BTC. This lets BTC be 'represented' on the Ethereum blockchain and can be used in different dApps, commonly financial ones. If you're familiar with ...


3

Just don't use BN. You need to convert ETH to WEI. This is a very simple proccess. Web3 has some buildt in functions for this: const val = 0.15; // this guy var weiAmount = web3.toWei(val);


3

There's no way for you to get them back, tokens sent to that particular contract that you're referring to, are stuck there forever. The contract that you link to has no way to withdraw tokens mistakenly sent to it. Perhaps your best chance is to reach out to the MWAT team and explain your situation, perhaps they can try to resolve it in someway.


3

An ERC20 contract must exactly implement the specification described here: https://eips.ethereum.org/EIPS/eip-20. This makes the critical behavior predictable so it will be compatible with wallets and exchanges. A contract may implement additional behaviour provided it doesn't interfere with the minimum functionality. It's worth noting that exchanges and ...


2

1) Matching the ERC777TokensRecipient interface is optional. More specifically, one single ERC1820 registry is deployed on most Ethereum networks, always at the same address: 0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24. The ERC1820 registry contains a mapping from addresses to contract addresses verifying the ERC777TokensRecipient interface. Those ...


2

Take a look at EIP 918: Mineable Token Standard. Proposed interface: contract ERC918 { function mint(uint256 nonce) public returns (bool success); function getAdjustmentInterval() public view returns (uint); function getChallengeNumber() public view returns (bytes32); function getMiningDifficulty() public view returns (uint); function ...


2

From Weenus 💪 ERC20 FaucetAnnouncing the Weenus 💪 ERC20 token faucets on the Ethereum mainnet, and Ropsten, Kovan, Rinkeby and Görli testnets: Search in your Ethereum blockchain explorer for WEENUS (18 decimals), XEENUS (18 decimals), YEENUS (8 decimals) or ZEENUS (0 decimals). Send a 0 value transaction from your account to the token contract addresses ...


2

You don't have to add function keyword in front of constructor. it won't show up during deployment because you are declaring it as contract function. Remove function keyword and try. definitely it will work. constructor (uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) public { balances[msg.sender] = _initialAmount; //...


2

The word token is used for an asset which utilizes an existing blockchain - it does not require its own blockchain. A token in the Ethereum ecosystem is a token which uses the Ethereum blockchain. On the other hand, cryptocurrency coins are typically something which requires its own blockchain - for example Ether is the cryptocurrency used in the Ethereum ...


2

The short answer is contracts (ERC20 and ERC721 tokens are contracts) don't need to deal with confirmations because that concern is handled by lower levels in the protocol stack. When you receive tokens from someone, the attack vectors are about the same as a regular transaction. You should watch a specific transaction to be sure it's confirmed. Hope it ...


2

This all depends on the token contract as all the transfer are performed inside the contract. Basically the contract supports whatever functionality you/someone writes in it. If there is no freezing functionality, it can't be added after deployment. Similar functionality can be achieved for example with some sort of escrow service but the token contract ...


2

You can do both of these things by using a smart contract. The limitation you will run into here is the amount of gas being used for this transaction. If you want to send many ERC20 tokens, you would use the following code in your smart contract: ERC20Interface(ERC20Token0).transfer(to_address, value); ERC20Interface(ERC20Token1).transfer(to_address, value)...


2

By design, you cannot do this. At this stage in the project, fund transfer to the Brave browser is uni-directional. You can send funds in but you cannot take them out. The reason this works is because the idea is that you pay content creators for their work on the platform. The creators can withdraw the funds they receive, provided they create an account ...


2

I'm not sure about the concrete theoretical underpinnings, but if by metaprogramming you mean 'code that writes code', then yes you can do metaprogramming in Ethereum. Solidity running on Ethereum Virtual Machine (EVM) allows following mechanisms to the programmers: Creating new objects on the fly. This also means creating objects (loosely speaking ...


2

These are multiple factors that would come into play. I can't bet 1000 TPS, but definitely much higher throughput than average. I have achieved transactions in three digits by playing with these factors in a private network. Consensus/ Engine used- PoA will always beat PoW in your case. Number of Nodes the lower the better! The more the number of nodes you ...


2

The deposit puts the control of tokens to the smart contract so that the smart contract can fill the orders. Smart contract allows tokens to be used only for this purpose - matching and filling orders. For example, the owners of the exchange cannot take control of user funds for their own purposes. Usually these smart contracts have trustless backdoor for ...


2

To deploy something, a transaction needs to be signed by a private key. The signing can be done by someone else than the developer, but it gets a bit complicated in my opinion. As I see it, you have at least a few different options: 1) The developer only develops code and you do all the rest (deployment and so on). When code is ready, he gives that to you....


2

Short answer: no need to worry if you are the one signing the deployment transaction, you don't need developers for that. Developers code and test with their wallets. They give you the code and you deploy it with your wallet. An easier way to do this, they can get the deployment code, ask you to sign it, they can deploy it themselves, but the transaction ...


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