Environment
Working on defender monitor and actions, for automatic pause
Details
- I am trying to run openzeppelin defender actions, but whenever I try to run,
const pauseTx = await contract.populateTransaction.pause();
or
// Send the transaction
const txResponse = await signer.sendTransaction({
to: safeAddress,
data: txData,
});
I am getting error -
No value provided for input HTTP label: FunctionName
- Also the dependencies are depreceated for - safe-sdk
Code to reproduce
Below is part of a code -
const { DefenderRelaySigner, DefenderRelayProvider } = require('defender-relay-client/lib/ethers');
const { ethers } = require('ethers');exports.handler = async function(event) {
console.log("Received event:", JSON.stringify(event, null, 2));// Initialize provider and signer const provider = new DefenderRelayProvider(event); const signer = new DefenderRelaySigner(event, provider, { speed: 'fast' }); // Define contract and ABI const contractAddress = '0x43636F829952e21673b6Ace16d0771f1DAbBb008'; const ABI = ["function pause() external"]; const contract = new ethers.Contract(contractAddress, ABI, signer); console.log("Before Populate"); // Ensure the method exists before calling populateTransaction if (!contract.populateTransaction.pause) { throw new Error("The contract does not have a method called 'pause'."); } // Populate the transaction const pauseTx = await contract.populateTransaction.pause(); --> Error Here console.log(`Transaction executed successfully with hash: ${txResponse.hash}`);
};