diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-09-13 19:45:27 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-09-19 23:56:23 +0800 |
commit | 6701ec68bdbda91e63ab199510469e3e6a421b57 (patch) | |
tree | 21d51c159d8f32f10af0f37e13c5b8723c5da2a2 /packages/contract_templates/contract.handlebars | |
parent | 7b259c3f4c09ea2d8bfe688238f046fa8c62ec03 (diff) | |
download | dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.tar dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.tar.gz dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.tar.bz2 dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.tar.lz dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.tar.xz dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.tar.zst dexon-sol-tools-6701ec68bdbda91e63ab199510469e3e6a421b57.zip |
Upgrade contract_templates to work with ethers 4.0
Diffstat (limited to 'packages/contract_templates/contract.handlebars')
-rw-r--r-- | packages/contract_templates/contract.handlebars | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars index 466893aa7..5c5f8c808 100644 --- a/packages/contract_templates/contract.handlebars +++ b/packages/contract_templates/contract.handlebars @@ -65,10 +65,12 @@ export class {{contractName}}Contract extends BaseContract { [{{> params inputs=ctor.inputs}}], BaseContract._bigNumberToString, ); - const txData = ethers.Contract.getDeployTransaction(bytecode, abi, {{> params inputs=ctor.inputs}}); + const iface = new ethers.Interface(abi); + let deployInfo = iface.deployFunction; + const txData = deployInfo.encode(bytecode, [{{> params inputs=ctor.inputs}}]); const web3Wrapper = new Web3Wrapper(provider); const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync( - txData, + {data: txData}, txDefaults, web3Wrapper.estimateGasAsync.bind(web3Wrapper), ); |