Hi all,
I've migrated my autotask code from legacy Defender to the v2 and it stops working.
When I run it, I have an
"Error while attempting request: Network arbitrum doesn't support EIP1559 transactions"
error.
My Relayer is on Arbitrum and I'm using web3.js to invoke custom contract method.
My code looks like:
const { DefenderRelayProvider } = require('@openzeppelin/defender-relay-client/lib/web3');
const Web3 = require('web3');
exports.handler = async function(event) {
const provider = new DefenderRelayProvider(event);
const web3 = new Web3(provider);
const [from] = await web3.eth.getAccounts();
const nftHandlerContract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS, { from });
await nftHandlerContract.methods.batchReplaceExtractor(["0xMYCONTRACTADDRESS"], [1], [2], [3]).send({ from })
.then(function(receipt){
console.log(`receipt: ${receipt}`);
})
.catch((error) => {
console.error(`error: ${error}`);
throw error;
});
}
logs look like that:
ACTION RUN
2024-07-01T16:52:28.711Z ERROR error: Error: Error while attempting request: Network arbitrum doesn't support EIP1559 transactions
END RequestId: b30546f5-7be2-4c91-a887-212f39894ef0
ACTION COMPLETE
2024-07-01T16:52:28.711Z ERROR Invoke Error
How to resolve it? What am I doing wrong here?
Thanks!