dsa-connectors/scripts/tests/encodeFlashcastData.ts
2021-12-06 05:07:37 +05:30

15 lines
394 B
TypeScript

import hre from "hardhat";
const { web3 } = hre;
import { encodeSpells } from "./encodeSpells.js";
export default function encodeFlashcastData(spells: any) {
const encodeSpellsData = encodeSpells(spells);
const targetType = "string[]";
let argTypes = [targetType, "bytes[]"];
return web3.eth.abi.encodeParameters(argTypes, [
encodeSpellsData[0],
encodeSpellsData[1],
]);
};