Not able to correctly send a transaction - BSC Testnet & Web3 - blockchain

After countless trials, I'm not able to send a transaction using the BSC tesntet, Web3 js and Metamask (I also tried with the Binance wallet).
It seems that everything works, but when I deploy the transaction I get errors like "nonce too low", "transaction underprices" and it doesn't matter if I manually change the nonce, gasLimit and price, and the amount to spend.
Any idea? Do you know if there is any working example or did you experience similar issue?
Any help/comment/suggestion is appreciated! Thank you in advance!
Used Binance testnet and web3 to code, sign and send a trasnaction --> I got several errors like "transaction underpriced", "nonce too low"

Related

Solution for brownie transact stuck with "Awaiting transaction in the mempool..."?

for like every 1 out of 10 transact, it got stuck with a Awaiting transaction in the mempool... in terminal.
it just stuck there forever, even if the transaction itself is already confirmed( on blockchain explorer).
I wonder if this is a brownie thing or a web3.py thing?
my evn(Brownie v1.16.4, Web3 5.23.1)

I am not able to register new ENS name in Ethereum Name Service

I am using JS library Web3 JS
My aim is to register a new ENS name like "demo1234.eth" on Ropsten Test Network
I tried
setResolver
web3.eth.ens.setResolver('demo1234.eth', '0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63',{from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
setOwner
web3.eth.ens.setOwner('demo1234.eth', {from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
setAddress
web3.eth.ens.setAddress('demo1234.eth','0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63', {from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
setRecord
web3.eth.ens.setRecord('demo1234.eth','0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5 ','0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63',3600 {from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
I am able to do send transaction to metamask wallet and after approval given to transaction it get failed after some time i am getting same error
Warning! Error encountered during contract execution [Reverted]
reference
even I tried to deploy a similar contract I found here
I am getting same error .
I have my wallet 0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63 on Ropsten Test Nework ,Even I have enough balance in my wallet (approx 8.4 eth)
please if any one know how can I successfully register new ENS name on test net How I registered on ens.domain
please guys help me if you can ... and
thank you so much in advance

MetaMask RPC error? 'MetaMask - RPC Error: Internal JSON-RPC error.'

I'm developing the front-end to an application that I'm trying to test. However, MetaMask keeps giving me this error? I tried changing the gas limit like previously suggested and nothing. Any ideas?
Error:
MetaMask - RPC Error: Internal JSON-RPC error.
code: -32603
data: {code: -32000, message: "gas required exceeds allowance (30000000) or always failing transaction"}
message: "Internal JSON-RPC error."
Without seeing the code, it's hard to say for sure but you could try:
Check any code you changed in the front end, specifically in your code you may have something like this:
const contractInstance = new state.web3.eth.Contract(
MyContract.abi,
"0x.....", // contract address
{
from: state.accounts[0],
gasPrice: 1000,
gas: 100000
}
);
Make sure the gas prices are similar to those, you may have to adjust for your case.
Re-compile and redeploy --> for truffle, run truffle develop first, then compile then migrate --reset for local deployment.
In Metamask, reset your test account. Metamask > Select Account > Settings > Advanced > Reset account. Only do this for testing accounts
Previously it used to happen in older versions due to a gas specification issue which was fixed. rpcErrors.internal` expects a string as the first argument, with arbitrary data being the optional second argument. Passing in a non-
string first argument results in the error being shadowed by an error
from eth-json-rpc-errors.
Please check what you are passing to Metamask.
In my case, after trying so many options I have restarted Ganache and re-imported new account from Ganache to Metamask.
I connected this new account with localhost application.
This resoles my issue.
Before performing any transaction the sending ETH address must be connected to your own site or UI. So it can get the address of sending account and goes towards the further transaction in the metamask.
Make sure Your sending account address must be connected to your UI.

To interact with smart contract without gasprice

I am using web3j java library to deploy and to interact with the smart contract. When I tried to send a transaction that invoke a function in smart contract by setting the gas price to 0 and gas limit to DefaultGasProvider.GAS_LIMIT. I am getting the below exception.
How to fix this issue?
With Remix and MetaMask it works without any issue. What am I missing when using web3j, any pointers would be of great help.
org.web3j.protocol.exceptions.TransactionException: Transaction has failed with status: 0x0. Gas used: 4300000. (not-enough gas?)
Only solidity ^0.4.25 supports sending transactions with gas price 0.

Can't send transactions on private test net

I have created a private test net according to the tutorial. Then i've created 2 accounts and i've one of them a bit of ether.
Now i try to send some ether :
tx = eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: amount})
I try it several times and like u can see on the picture nothing happened.
How can i resolve this?
For succeeded those Transanctions the server should be mining in the same time. And it's take some time (5-7)mins to a succesful transactions.