I wrote the script below locally and created a task with defender-autotask-client
require("dotenv").config();
const {
DefenderRelayProvider,
DefenderRelaySigner,
} = require("defender-relay-client/lib/ethers");
const { execute } = require("../task");
exports.handler = async function () {
const contractAddress = process.env.CONTRACT_ADDRESS;
const abi = [{.....}];
const credentials = {
apiKey: process.env.RELAY_API_KEY,
apiSecret: process.env.RELAY_API_SECRET,
};
const provider = new DefenderRelayProvider(credentials);
const signer = new DefenderRelaySigner(credentials, provider, {
speed: "fast",
});
await execute(contractAddress, abi, signer);
};
Got this error when triggered
When I create a task with the direct value the .env helped with it, everything worked well.