1

I have an smart contract running over Ethereum mainnet, Rinkeby, Kovan and BSC. I am using web3.js to sign transactions in the following way:

var data        = contract.methods.MyFunction(from+'', value+'').encodeABI();
var rawTrx  = {"to": CONTRACT_ADDRESS, "gas": 5000000, "nonce":nonce, "data": data };   

web3js.eth.accounts.signTransaction(rawTrx, SIGN)
.then(signedTx => web3js.eth.sendSignedTransaction(signedTx.rawTransaction))
.then(function(receipt){ return true; })
.catch((err) => { console.log("ERROR 1: " + err); return false;});

I send it by the Polygon RPC URL: https://polygon-rpc.com

It returns several errors indifferently like:

  • ERROR 1: Error: Returned error: tx fee (1.50 ether) exceeds the configured cap (1.00 ether)

  • ERROR 1: Error: Returned error: replacement transaction underpriced

  • ERROR 1: Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!

Any idea why only happend in Polygon Matic network? Works perfectly in the other Ethereum compatible networks.

1 Answer 1

1

Seems a problem with the network nonce managment. Remove the nonce from the rawTrx and let the Polygon network assign one.

3
  • Thank you. It works if I send one transaction. I need to send my own correlative nonces for a transaction list. Any idea? Dec 14, 2021 at 15:50
  • 1
    Try to call first web3.eth.getTransactionCount() and after response send your signed transaction with a nonce
    – JTCon
    Dec 14, 2021 at 17:59
  • Works thank you! Dec 14, 2021 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.