diff --git a/lib/contracts/blockchain.js b/lib/contracts/blockchain.js index 352fd7754..27463d199 100644 --- a/lib/contracts/blockchain.js +++ b/lib/contracts/blockchain.js @@ -90,6 +90,10 @@ class Blockchain { this.web3.eth.getBlock(blockNumber, cb); } + ContractObject(params) { + return new this.web3.eth.Contract(params.abi); + } + } module.exports = Blockchain; diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index 3d957a4ad..08b122ee6 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -308,7 +308,7 @@ class Deploy { }); }, function createDeployObject(next) { - let contractObject = new self.web3.eth.Contract(contract.abiDefinition); + let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition}); try { const dataCode = contractCode.startsWith('0x') ? contractCode : "0x" + contractCode;