From 0b1c2bc9c9f82f724f25a3d2c96a8bede716dab0 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Sun, 13 Oct 2024 13:08:41 +0300 Subject: [PATCH] - fixed the depositSC.ts task --- tasks/depositSC.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tasks/depositSC.ts b/tasks/depositSC.ts index ca6b375..04af3c4 100644 --- a/tasks/depositSC.ts +++ b/tasks/depositSC.ts @@ -4,9 +4,7 @@ task("deposit-sc", "Deposits token and sends to safe") .addParam("address", "Address of the token to be sent") .addParam("amount", "Amount we want to deposit (full value, with decimals)") .addParam("sc", "MultiversX address hex encoded of the receiver") - .addParam("endpoint", "data field for MVX SC execution") - .addParam("gaslimit", "data field for MVX SC execution") - .addParam("args", "data field for MVX SC execution") + .addParam("calldata", "SC call data in hex format") .addOptionalParam("price", "Gas price in gwei for this transaction", undefined) .setAction(async (taskArgs, hre) => { const fs = require("fs"); @@ -20,16 +18,13 @@ task("deposit-sc", "Deposits token and sends to safe") const address = taskArgs.address; const amount = taskArgs.amount; const receiver = taskArgs.sc; - const endpoint = taskArgs.endpoint; - const gaslimit = taskArgs.gaslimit; - const args = JSON.parse(taskArgs.args); + const callData = taskArgs.calldata - const callData = encodeCallData(endpoint, gaslimit, args); await safe.depositWithSCExecution( address, amount, Buffer.from(receiver, "hex"), - callData, + Buffer.from(callData, "hex"), getDeployOptions(taskArgs), ); });