aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract_templates/partials
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-08-09 09:28:15 +0800
committerGitHub <noreply@github.com>2018-08-09 09:28:15 +0800
commit53713188fee57391040c24cc627fdc5ab8982d2e (patch)
tree8bfcf59197506af235f772cb8fc78f6315932c4f /packages/contract_templates/partials
parent03fb73d1d2017b41551f47552a5ca06f0dfb0f08 (diff)
parentc4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b (diff)
downloaddexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.tar
dexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.tar.gz
dexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.tar.bz2
dexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.tar.lz
dexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.tar.xz
dexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.tar.zst
dexon-sol-tools-53713188fee57391040c24cc627fdc5ab8982d2e.zip
Merge pull request #915 from 0xProject/feature/encode-decode-checks
Add strictArgumentEncodingCheck to BaseContract and use it in contract templates
Diffstat (limited to 'packages/contract_templates/partials')
-rw-r--r--packages/contract_templates/partials/callAsync.handlebars1
-rw-r--r--packages/contract_templates/partials/tx.handlebars1
2 files changed, 2 insertions, 0 deletions
diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars
index fcaae57c6..94752691d 100644
--- a/packages/contract_templates/partials/callAsync.handlebars
+++ b/packages/contract_templates/partials/callAsync.handlebars
@@ -7,6 +7,7 @@ async callAsync(
const functionSignature = '{{this.functionSignature}}';
const inputAbi = self._lookupAbi(functionSignature).inputs;
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
+ BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]);
const ethersFunction = self._lookupEthersInterface(functionSignature).functions.{{this.name}}(
{{> params inputs=inputs}}
) as ethers.CallDescription;
diff --git a/packages/contract_templates/partials/tx.handlebars b/packages/contract_templates/partials/tx.handlebars
index e297d05e6..4340d662e 100644
--- a/packages/contract_templates/partials/tx.handlebars
+++ b/packages/contract_templates/partials/tx.handlebars
@@ -11,6 +11,7 @@ public {{this.tsName}} = {
const self = this as any as {{contractName}}Contract;
const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
[{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
+ BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]);
const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}(
{{> params inputs=inputs}}
).data;