@kiroboio/fct-core
Version:
Kirobo.io FCT Core library
34 lines • 1.37 kB
JavaScript
import { ethers } from "ethers";
import { deepMerge } from "../../../helpers";
import { Utils_oldVersion } from "../oldVersion/Utils";
import BatchMultiSigCallABI_020201 from "./abis/FCT_BatchMultiSigCall.abi.json";
const IBatchMultiSigCall = new ethers.utils.Interface(BatchMultiSigCallABI_020201);
export class Utils_020201 extends Utils_oldVersion {
getCalldataForActuator({ signatures, purgedFCT, investor, 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