From 2800e347de4c0d93228e044e2aad4e655db62579 Mon Sep 17 00:00:00 2001 From: emizzle Date: Fri, 17 Aug 2018 14:49:27 +1000 Subject: [PATCH] add contract class for assisted construction # Conflicts: # package-lock.json --- lib/contracts/contract.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/contracts/contract.js diff --git a/lib/contracts/contract.js b/lib/contracts/contract.js new file mode 100644 index 00000000..df2aa677 --- /dev/null +++ b/lib/contracts/contract.js @@ -0,0 +1,22 @@ +class Contract { + constructor(className, compiledContract, gas, gasPrice, type = 'file') { + this.className = className; + this.gas = gas; + this.gasPrice = gasPrice; + this.type = type; + this.compiledContract = compiledContract; + } + + set compiledContract(compiledContract) { + this.code = compiledContract.code; + this.runtimeBytecode = compiledContract.runtimeBytecode; + this.realRuntimeBytecode = (contract.realRuntimeBytecode || contract.runtimeBytecode); + this.swarmHash = compiledContract.swarmHash; + this.gasEstimates = compiledContract.gasEstimates; + this.functionHashes = compiledContract.functionHashes; + this.abiDefinition = compiledContract.abiDefinition; + this.filename = compiledContract.filename; + this.originalFilename = compiledContract.originalFilename || ("contracts/" + contract.filename); + } + +} \ No newline at end of file