UNPKG

@kiroboio/fct-core

Version:

Kirobo.io FCT Core library

34 lines 1.42 kB
import { ethers } from "ethers"; import { deepMerge } from "../../../helpers"; import { UtilsBase } from "../bases/UtilsBase"; import BatchMultiSigCallABI from "./abis/FCT_BatchMultiSigCall.abi.json"; const IBatchMultiSigCall = new ethers.utils.Interface(BatchMultiSigCallABI); export class Utils_oldVersion extends UtilsBase { getCalldataForActuator({ signatures, purgedFCT = ethers.constants.HashZero, investor = ethers.constants.AddressZero, activator, externalSigners = [], variables = [], }) { if (!this.FCT) { throw new Error("FCT not found, should not be the case"); } const signedFCT = deepMerge(this.FCT?.export(), { signatures, externalSigners, variables }); return this.getCalldataForActuatorWithSignedFCT({ signedFCT, purgedFCT, investor, activator, version: this.FCT.version, }); } getCalldataForActuatorWithSignedFCT({ signedFCT, purgedFCT, investor, activator, version, }) { version = version.startsWith("0x") ? version : `0x${version}`; return IBatchMultiSigCall.encodeFunctionData("batchMultiSigCall", [ version.padEnd(66, "0"), signedFCT, purgedFCT, investor, activator, ]); } getBatchMultiSigCallABI() { return IBatchMultiSigCall; } } //# sourceMappingURL=Utils.js.map