Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
eth-crypto/dist/es/tx-data-by-compiled.js

11 lines
521 B

import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
import { ContractFactory } from 'ethers';
export function txDataByCompiled(abi, bytecode, args) {
// solc returns a string which is often passed instead of the json
if (typeof abi === 'string') abi = JSON.parse(abi);
// Construct a Contract Factory
var factory = new ContractFactory(abi, '0x' + bytecode);
var deployTransaction = factory.getDeployTransaction.apply(factory, _toConsumableArray(args));
return deployTransaction.data;
}