New answers tagged

1

will a transaction that alters the state do so before the next transaction, regardless of whether it is in the same block? Yes if their transactions are in the same block, would the second transaction be rejected? Yes An important point is that neither Alice or Bob knows who is first: the miner decides which transaction is first. See also What is the ...


0

Gas is the accounting system used to work out how much ether the sender pays to perform transaction. The ethereum yellow paper (appendix G) sets out the schedule of gas prices per EVM operation. The transaction sender sets a value in ether that they are willing to pay per unit of gas. The miners can survey the pool of valid transactions and pick the ones ...


0

Your gas price is too low. You can check over here for an "estimate", currently 2 gwei as I write: https://ropsten-stats.parity.io/ I imagine you mean to say 8 gwei but it is off by several orders of magnitude. This is an opportunity to learn about stuck transactions and now to resolve them which any process that sends transactions at scale should ...


0

The suitable answer to the date: class TransactionChecker { constructor(address) { this.address = address.toLowerCase(); this.web3 = new Web3("https://mainnet.infura.io/v3/60968ff3b2f84a0ebdff7a993f4d080b"); } async checkBlock() { let block = await this.web3.eth.getBlock('latest'); let number = block.number; let ...


1

I had a number of things wrong: To add to @clement's answer, tx should be: tx = { nonce: nonce, gasPrice: gasPrice, gasLimit: gasLimit, to: contractAddress, value: value, data: contractData, chainId : 1, }); //add chainId I also needed to create an account object: let acc = await web3.eth.accounts.wallet.add(signingPrivateKey) ...


1

The tx object is the following : tx = { nonce: nonce, gasPrice: gasPrice, gasLimit: gasLimit, to: contractAddress, value: value, data: contractData, }); I think what you are looking for is the data parameter which is obtained using the enoceABI() web3 function (cf https://web3js.readthedocs.io/en/v1....


0

To complete the first answer, there is a distributed storage platform, called Swarm (https://swarm.ethereum.org/), that has been specially built to work with Ethereum dApps.


1

There isn't rights answer to your question, depends on the use case and on the business model. If you want to adopt a full decentralize ecosystem use a distributed decentralize storage (like ipfs, storj ecc) If you want to store data offchain use legacy file system :) Database or local system. There isnt a better way but a different model to use data. ...


0

There is no fixed gas price that transactions must have. However, you can use the fast gas feed from the Chainlink decentralized oracle service to tell you what gas price you need to set for your transaction to go through "fast". The fast gas feed gets independent updates from different oracles and posts an aggregate of it on-chain, so anyone can ...


2

The msg.sender is always the address of the entity who called the current contract. When a contract calls another contract the msg.sender changes. Let me give you some examples. Assuming we have a EOA (Externally Owned Account) A and contracts B and C. When A calls B the msg.sender in B is A's public address. If contract B also calls contract C, msg.sender ...


0

If it's a regular Proof-of-Work blockchain then the miners' rewards are minted, so they appear out of thin air. Here's some more info about mining: https://cointelegraph.com/ethereum-for-beginners/how-to-mine-ethereum-guide-for-beginners As for the gas cost, the sender of the transaction always pays for the gas. But as it's your own blockchain this is quite ...


0

I dont mean to hijack your thread but my question is very similar. Im sending SNX from Metamask, 29.59 Gwei (which it warned me was extremely low) but its been 3 days which im not sure is normal. https://etherscan.io/tx/0x2895be03a8be8b91d92d688fce4262a2d063575a96456625fa5441f5477318ce Hopefully somebody here can let me know if I should just wait longer?


0

If you're not on the mainnet, you have to specify the network : const tx = new Tx(txObject, { chain: 'ropsten'}) That's because your signature will differ from one network to another (protection against replay attacks, cf EIP-155 : https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md).


2

You can do this way : const EthereumTx = require('ethereumjs-tx').Transaction; import Common from 'ethereumjs-common'; const customCommon = Common.forCustomChain( 'mainnet', { name: 'my-private-blockchain', networkId: NETWORK_ID, chainId: CHAIN_ID, }, 'istanbul', ); ...


1

Smart contracts cannot "pull" Ether from an external address. All transactions have to be sent by the user itself. You can however use wrapped ETH, which is essentially Ether wrapped as an ERC-20 token, where 1 ETH equals 1 WETH. Both users have to convert their ETH into WETH first. You can make a flow for this on your dApp's website. Then, have ...


0

Never-mind, all went through after about 24 hours. With a very low fee actually. Strange that on Metamask this tx was showing confirmed while it wasn't on the block


Top 50 recent answers are included