Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the depositSC.ts task #72

Merged
merged 2 commits into from
Oct 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the import of encodeCallData from the beginning of the file

await safe.depositWithSCExecution(
address,
amount,
Buffer.from(receiver, "hex"),
callData,
Buffer.from(callData, "hex"),
getDeployOptions(taskArgs),
);
});
Loading