Skip to content

Commit

Permalink
- fixed the depositSC.ts task
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau committed Oct 13, 2024
1 parent 789f14c commit 0b1c2bc
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tasks/depositSC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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),
);
});

0 comments on commit 0b1c2bc

Please sign in to comment.