add contract class for assisted construction

# Conflicts:
#	package-lock.json
This commit is contained in:
emizzle 2018-08-17 14:49:27 +10:00 committed by Pascal Precht
parent c844338c8a
commit 2800e347de
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 22 additions and 0 deletions

22
lib/contracts/contract.js Normal file
View File

@ -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);
}
}