Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gasData: []
};
this.deployments.push(contractInfo);
// Report gas used during pre-test deployments (ex: truffle migrate)
if (contract.deployed && contract.deployed.transactionHash) {
this.trackNameByAddress(name, contract.deployed.address);
const receipt = this.sync.getTransactionReceipt(
contract.deployed.transactionHash
);
contractInfo.gasData.push(utils.gas(receipt.gasUsed));
}
// Decode, getMethodIDs
const methodIDs = {};
const methods = new ethersABI.Interface(contract.abi).functions;
// Generate sighashes and remap ethers to something similar
// to abiDecoder.getMethodIDs
Object.keys(methods).forEach(key => {
const raw = ejsUtil.keccak256(key);
const sighash = ejsUtil.bufferToHex(raw).slice(2, 10);
methodIDs[sighash] = methods[key];
});
// Create Method Map;
Object.keys(methodIDs).forEach(key => {
const isInterface = contract.bytecode === "0x";
const isCall = methodIDs[key].type === "call";
const methodHasName = methodIDs[key].name !== undefined;
if (methodHasName && !isCall && !isInterface) {
Contract.getInterface = function (contractInterface) {
if (abi_1.Interface.isInterface(contractInterface)) {
return contractInterface;
}
return new abi_1.Interface(contractInterface);
};
// @TODO: Allow timeout?
static getInterface(contractInterface) {
if (Interface.isInterface(contractInterface)) {
return contractInterface;
}
return new Interface(contractInterface);
}
// @TODO: Allow timeout?