New answers tagged

0 votes

Can't send a new transaction with a lower nonce while the previous one is still pending

Not all transactions can cancel or accelerate by metamask. I have a pending transaction "APROBE USE CRYPO" in nonce 0 cannot replace or accelerate.
user avatar
0 votes

Await transaction using `go-ethereum/ethclient`

I think the function waitMined is the function you are looking for. bind.WaitMined(context.Background(), client, signedTx)
user avatar
  • 101
0 votes

How to interact with mainnet smart contracts by GOlang?

you can refer this link https://goethereumbook.org/smart-contract-read-erc20 for simplicity you can also directly use the package github.com/liyue201/erc20-go/erc20 and call the balance functions like ...
user avatar
0 votes
Accepted

Transfer function not changing custom token(ERC20) balance after successful transfer from transfer function?

Ok, Whilst in progress with a project I was doing, The transfer function cannot be used for this. So instead use transferFrom function that is provided by ERC20. But to use it, You first need to give ...
user avatar
0 votes

What’s the difference between fallback() and receive() and between payable vs transfer?

Fallback functions can be used instead of receive functions. However, to clearly distinguish between eth transferring and not, receive functions are being used now.
user avatar
0 votes

Get to and from address using Transaction hash

If you use web3.py, you need some python logic but you can make it work! Assuming that you already have a tx hash, use the eth.getTransaction method to retrieve the tx details and place them in a ...
user avatar
  • 51
0 votes

Get Transaction details using Python

Using web3.py you can use the eth.get_transaction method to get transactions details from a tx hash. Connect to a node, I recommend to use chainstack.com, it`s free and works great. from web3 import ...
user avatar
  • 51
1 vote

Does calling a read function with input leave any trace?

You can do calculations, read global variables (not edit), make local variables in a function to be called without showing any trace in blockchain. When you call read function below, it will not be ...
user avatar
0 votes
Accepted

How to specify priority fee and max fee per gas in Geth' JSON-RPC API?

I think you can either use max_gas_fee or maxGasFee. The following works for me: "params": [{ "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "to": &...
user avatar
  • 31.3k
0 votes

I am trying to create a store_transaction and change the Blockchain by passing a value

THE Fix : transaction = SimpleStorage.constructor().buildTransaction({ "gasPrice": w3.eth.gas_price, "chainId": chain_id, "from": my_address, "...
user avatar
  • 1
0 votes

What if I as a miner , include some wrong transactions in the block and push it . What is the process so that other nodes get notified about it?

You're asking too big a question. Generally speaking, incorrect transactions are recognizable because other miners would disagree with the proofs. Try the beigepaper. It's not as complete, but it's a ...
user avatar
0 votes

Does an ETH purchase on a CEX result in creation of a Tx on the ETH network?

No, any trade of an exchange is internal and does not appear on the blockchain, hence why it's defined as centralized. Decentralized exchanges (DEXs), such as Uniswap, happen on the blockchain.
user avatar
  • 1,186
0 votes

Pulling a price of a specific token contract from a specific point in time

I'm looking for the same - or similar. I want look up for example price of SINGLE/USDC Liquidity Pool in vvs.finance (CRONOS chain). The closet I found are: Look up current price from Liquidity Pool ...
user avatar
0 votes

How can read the data field in a transaction?

https://api-rinkeby.etherscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=HASH&apikey=YourApiKeyToken response's input field is the corresponding hex data.
user avatar
0 votes

sign transaction in web3 with metamask

As far as I know it's not possible to sign transaction with Metamask. I can imagine it's due to security reasons (some evil dapp could sign tx and then do not send it in network until it can execute ...
user avatar
2 votes

what is parent transaction in ethereum

Answering here because I found this question through a search engine. While inspecting a block, I've come accross the phrase Parent Tx Hash. It shows up when looking at the internal transactions that ...
user avatar
  • 127
2 votes
Accepted

What are some APIs that write transactions to the blockchain?

There are many services to interact with the blockchain - Infura https://docs.infura.io/infura/networks/ethereum/json-rpc-methods Alchemy https://www.alchemy.com/ Also Kaleido. Amazon Managed ...
user avatar
  • 1,186
1 vote
Accepted

Can I store random data with eth_sendTransaction?

You can store a string, but encoded as a hex string. To store 'I love lamp' you need to set data: '0x49206c6f7665206c616d70'. Use utf8ToHex to convert a string to hex bytes - web3.utils.utf8ToHex('I ...
user avatar
  • 1,186
0 votes
Accepted

Etherscan API get transaction status from getLogs api call

Reverted transactions don't have logs, so any transaction that has logs, must be a transaction that got mined and didn't revert. So status must be true for any transaction you receive from getLogs. ...
user avatar
  • 1,186
1 vote
Accepted

How much ether was transferred in this transaction?

You can see how much ETH was transferred, by taking the "value" variable and dividing it with 10"18. The number you get is the amount of ETH sent. (Note the amount is only sent if the ...
user avatar
  • 530
0 votes
Accepted

Payable function transaction failing

The safest way to represent the value of your smart contract is to use a variable rather than address(this).balance. This can easily be manipulated by sending ether to your contract (even if you don't ...
user avatar
  • 880
1 vote
Accepted

Weird block: miner prioritized lower gas TXs (200 times lower!) and let others fail. Analysis and questions

It's a private transaction. Basically a transaction that was fed directly to the miner, not through the mempool. Miners earn more through MEV, either running their own code to take value from mempool (...
user avatar
  • 1,186
1 vote

Fee for making a transaction Vs fee for recording a transaction

These are awesome questions! I'll try to answer each with some additional context. The first paragraph of each section is a rough summary, the rest is additional context. Why can the gas amount be ...
user avatar
1 vote

How does a single getter call get chosen by a node if there's no reward associated?

Only transactions are distributed to the miners to be executed. The calls to view functions are executed by the web3 provider. If you run your own node the query will be executed locally, if you use a ...
user avatar
  • 29.2k
0 votes

Receive deployed contract address by transaction hash with JSON-RPC request

Using JSON-RPC to a node it's only possible if the constructor emitted an event upon creation, like @natewelch_ offered. You can then then call getLogs of that event and read the block number. Another ...
user avatar
  • 1,186
0 votes

If two transactions has the same gas fees, base gas fees, max priority fees, which transaction will come first in the same block?

Regardless of any fees, it's up to the miners to decide (as long as the fee meets some minimum requirements). So a miner can choose to include whichever transaction wherever in a block. However, in ...
user avatar
1 vote

Is it possible to check when a transaction has been sent?

Theoretically, on a blockchain that implements this - it's possible. On Ethereum (and forks) it's impossible, since the info of transmission time isn't recorded in the transaction. The only way to ...
user avatar
  • 1,186
0 votes
Accepted

How to recover Ethereum Public Key from Transaction

As far as I know, Web3.js doesn't expose such functionalities directly. You could however do it by relying on one of its dependencies (@ethereumjs/tx). Here is an example code heavily inspired by the ...
user avatar
  • 4,919
0 votes

The same wallet address on the Mainnet Ethereum network and on the Polygon network. Are these two different wallets with two different owners?

Most of the time its same. But not always. Polygon Mainnet have made its own chain, which is seperate from Ethereum chain. When we create wallet by wallet providers like metamask the wallet address of ...
user avatar
0 votes

The same wallet address on the Mainnet Ethereum network and on the Polygon network. Are these two different wallets with two different owners?

It is likely that yes. Both polygon and ethereum use the same format for wallet addresses, and with the same private key you could sign transactions for both chains.
user avatar
  • 29.2k
0 votes

Error: [ethjs-query] while formatting outputs from RPC: "message":"invalid sender"

all read calls of blockchain works all write calls of blochain does not work var tx = await contractReference.functionName(parameter1, parameter2); console.log(tx) //this statement will ...
user avatar
  • 1
0 votes

How can I send erc20 tokens at once from MULTIPLE wallets to a single address?

If we are talking about the regular ERC20 or ERC721 tokens, then the only option is for the wallets to give allowance for some contract to withdraw the tokens. That requires a transaction from each of ...
user avatar
0 votes
Accepted

events can cause state change?

This answer might clarify it alongside this one. In essence, transactions receipts (containing the logs) are used to form the Transaction Receipt Trie, which will update the Transaction Receipts Root ...
user avatar
  • 4,919
0 votes

Compute transaction hash locally?

For web3 there's web3.eth.signTransaction returns the hash of the transaction in the 'hash' field. { raw: '0xf86c...', tx: { nonce: '0x0', ... hash: '...
user avatar
  • 29.2k
0 votes

transfer vs transferFrom "amount exceeds allowance" when sender is the same as msg.sender

transferFrom () gives you option of allowing another address to take specified amount of tokens from your address (That is basic use case for that function). Making sure you are "allowed" to ...
user avatar
  • 530

Top 50 recent answers are included