Force sending a transaction using ethers

Viewed 266

I am using ethers js and want to send a transaction forcefully that might result in an error. Metamask allows me to do so, and so does remix, by hitting 'force send' - but when I do a contract call in my ethers code through a JSON RPC, it gives me an error saying 'transaction reverted: '

How can I force send a transaction programatically?

2 Answers

Solved - I was able to do this by overriding gas limit and gas price.

In order to do so, overrides object with preset param gasLimit should be passed as last parameter. See more at ethers docs

Reference to ethers library maintainer comment here

Related