Ethereum questions and answers

Ethereum

Truffle fails to test ERC20 approval

A am implementing a custom ERC20 token inheriting from OpenZeppelin's StandardToken (https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/StandardToken.sol). I override some of the functions but did not override approve or allowance. I write a test for approval: contract('MyToken', async(accounts) => { it("approve test", async() => { let token = await MyToken.deployed(); let approveResult = await token.approve.call(accounts, ....

Oliver Oliver: 50 minutes ago

Ethereum

How to validate the Chainlink price feed at a specific time

Suppose that in my solidity contract, I need to see the price of ETH in terms of USD at a specific time, say on January 1, 2021. I would like to use the Historical Price Data Feed from chainlink (URL below). I imagine that to achieve this, I would have ....

Alexander Alexander: 1 hour ago

Ethereum

Extending Issued ERC 20 Token

I have already issued my ERC 20 token. But I want to add a time locking functionality to the token so the tokens issued during pre-sale / ICO will be time locked in user's wallets. Is this possible? ....

Lucas Lucas: 2 hours ago

Ethereum

ComponentDidMount doesn' detect Metamask change account

I'm quite new to Web3 and Metamask and would like to ask how should I change the basic componenDidMount of the React truffle box so that it can detect and change accounts when I'm switching an account on Metamask. Here is the code: Class App extends Component { state = ....

Liam Liam: 2 hours ago

Ethereum

Cannot call function in openzepplin ERC1155 contract via web3/metamask

I am trying to call the balanceOf function in a pretty barebones openzepplin ERC1155 contract through metamask. I am using web3 only to generate the ABI, and metamask to actually send out the call. Here is my code for the call, const call = web3.eth.abi.encodeFunctionCall( { name: 'balanceOf', type: 'function', ....

Mia Mia: 3 hours ago

Ethereum

Will pooled staking be implemented using multisig deposits?

Would this be a valid implementation for an ether staking pool if the goal was to eliminate the need for depositors to forfeit control of their ether to the pool owner? Depositor creates a contract and sends the ether they wish to stake to that contract The contract controls 2 ....

Mia Mia: 3 hours ago

Ethereum

Mining with additional data

i'm a beginner in using blockchain. Based on my knowledge, there are two ways blocks are created, mining and sending transactions. As there is an explanation to input additional data while sending a new transaction to other user in here: How do I send an arbitary message to an Ethereum ....

James James: 4 hours ago

Ethereum

(Remix IDE) Getting VM error: invalid opcode in Javascript VM,

I'm creating an ERC20 token that will have 9 separate funding rounds. When I call the startNextRound function in the JavaScript VM, I get the following error: transact to browser/SatanCoin.sol:SatanCoin.startNextRound errored: VM error: invalid opcode. The constructor should be payable if you send value. The execution might have thrown. Debug ....

Liam Liam: 7 hours ago

Ethereum

why ERC20 standard doesn't have any method to remove the spender allowance´╝č

ERC20 token standard uses approve() and transferFrom() to do the indirect transfer. function approve(address spender, uint256 value) public returns (bool success) { allowance = value; Approval(msg.sender, spender, value); return true; } As shown above, the approve() method uses the variable - allowance to add the mapping, so the owner can ....

Henry Henry: 9 hours ago

Ethereum

How interact with Ethereum without (gas) ether?

Ethereum is not a currency but use ether (gas) to pay the fees, therefore someone will need an Ether account to pay and build the application. But how can someone get an account for each activity previously mentioned (to buy/sell ether and build the app)? ....

Charlotte Charlotte: 9 hours ago