aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/contract_templates
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-24 06:13:35 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-02-28 04:05:46 +0800
commit93b2736d6533f983aeb74005004de7f40eb35851 (patch)
tree51f25e54b7afeebc7fc482bf78f12a0f9bb1eda1 /packages/contracts/contract_templates
parent34274a10428bbc07a4f075bcf4a3ccafe0c04f5e (diff)
downloaddexon-sol-tools-93b2736d6533f983aeb74005004de7f40eb35851.tar.gz
dexon-sol-tools-93b2736d6533f983aeb74005004de7f40eb35851.tar.zst
dexon-sol-tools-93b2736d6533f983aeb74005004de7f40eb35851.zip
Use the same templates as 0x.js
Diffstat (limited to 'packages/contracts/contract_templates')
-rw-r--r--packages/contracts/contract_templates/contract.handlebars44
-rw-r--r--packages/contracts/contract_templates/partials/call.handlebars10
-rw-r--r--packages/contracts/contract_templates/partials/event.handlebars5
-rw-r--r--packages/contracts/contract_templates/partials/params.handlebars3
-rw-r--r--packages/contracts/contract_templates/partials/return_type.handlebars10
-rw-r--r--packages/contracts/contract_templates/partials/tx.handlebars36
-rw-r--r--packages/contracts/contract_templates/partials/typed_params.handlebars3
7 files changed, 0 insertions, 111 deletions
diff --git a/packages/contracts/contract_templates/contract.handlebars b/packages/contracts/contract_templates/contract.handlebars
deleted file mode 100644
index 84b0696b1..000000000
--- a/packages/contracts/contract_templates/contract.handlebars
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * This file is auto-generated using abi-gen. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
- */
-// tslint:disable:async-suffix member-ordering no-consecutive-blank-lines
-// tslint:disable-next-line:no-unused-variable
-import { TxData, TxDataPayable } from '@0xproject/types';
-import { BigNumber, classUtils, promisify } from '@0xproject/utils';
-import * as Web3 from 'web3';
-
-import {BaseContract} from './base_contract';
-
-{{#if events}}
-export type {{contractName}}ContractEventArgs =
-{{#each events}}
- | {{name}}ContractEventArgs{{#if @last}};{{/if}}
-{{/each}}
-
-export enum {{contractName}}Events {
- {{#each events}}
- {{name}} = '{{name}}',
- {{/each}}
-}
-
-{{#each events}}
-{{> event}}
-
-{{/each}}
-{{/if}}
-
-export class {{contractName}}Contract extends BaseContract {
-{{#each methods}}
- {{#this.constant}}
- {{> call contractName=../contractName}}
- {{/this.constant}}
- {{^this.constant}}
- {{> tx contractName=../contractName}}
- {{/this.constant}}
-{{/each}}
- constructor(web3ContractInstance: Web3.ContractInstance, defaults?: Partial<TxData>) {
- super(web3ContractInstance, defaults);
- classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']);
- }
-} // tslint:disable:max-file-line-count
diff --git a/packages/contracts/contract_templates/partials/call.handlebars b/packages/contracts/contract_templates/partials/call.handlebars
deleted file mode 100644
index 82a45b40e..000000000
--- a/packages/contracts/contract_templates/partials/call.handlebars
+++ /dev/null
@@ -1,10 +0,0 @@
-public async {{this.name}}(
-{{> typed_params inputs=inputs}}
- defaultBlock?: Web3.BlockParam,
-): Promise<{{> return_type outputs=outputs}}> {
- const self = this as {{contractName}}Contract;
- const result = await self._web3ContractInstance.{{this.name}}.call(
- {{> params inputs=inputs}}
- );
- return result;
-}
diff --git a/packages/contracts/contract_templates/partials/event.handlebars b/packages/contracts/contract_templates/partials/event.handlebars
deleted file mode 100644
index 3c6100e4f..000000000
--- a/packages/contracts/contract_templates/partials/event.handlebars
+++ /dev/null
@@ -1,5 +0,0 @@
-export interface {{name}}ContractEventArgs {
- {{#each inputs}}
- {{name}}: {{#returnType type components}}{{/returnType}};
- {{/each}}
-}
diff --git a/packages/contracts/contract_templates/partials/params.handlebars b/packages/contracts/contract_templates/partials/params.handlebars
deleted file mode 100644
index ac5d4ae85..000000000
--- a/packages/contracts/contract_templates/partials/params.handlebars
+++ /dev/null
@@ -1,3 +0,0 @@
-{{#each inputs}}
-{{name}},
-{{/each}}
diff --git a/packages/contracts/contract_templates/partials/return_type.handlebars b/packages/contracts/contract_templates/partials/return_type.handlebars
deleted file mode 100644
index 40a5dd8b0..000000000
--- a/packages/contracts/contract_templates/partials/return_type.handlebars
+++ /dev/null
@@ -1,10 +0,0 @@
-{{#if outputs.length}}
-{{#singleReturnValue}}
-{{#returnType outputs.0.type}}{{/returnType}}
-{{/singleReturnValue}}
-{{^singleReturnValue}}
-[{{#each outputs}}{{#returnType type}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}]
-{{/singleReturnValue}}
-{{else}}
-void
-{{/if}}
diff --git a/packages/contracts/contract_templates/partials/tx.handlebars b/packages/contracts/contract_templates/partials/tx.handlebars
deleted file mode 100644
index 69ae982d6..000000000
--- a/packages/contracts/contract_templates/partials/tx.handlebars
+++ /dev/null
@@ -1,36 +0,0 @@
-public {{this.name}} = {
- async sendTransactionAsync(
- {{> typed_params inputs=inputs}}
- {{#this.payable}}
- txData: TxDataPayable = {},
- {{/this.payable}}
- {{^this.payable}}
- txData: TxData = {},
- {{/this.payable}}
- ): Promise<string> {
- const self = this as {{contractName}}Contract;
- const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(txData);
- const txHash = await self._web3ContractInstance.{{this.name}}(
- {{> params inputs=inputs}}
- txDataWithDefaults,
- );
- return txHash;
- },
- async callAsync(
- {{> typed_params inputs=inputs}}
- {{#this.payable}}
- txData: TxDataPayable = {},
- {{/this.payable}}
- {{^this.payable}}
- txData: TxData = {},
- {{/this.payable}}
- ): Promise<{{> return_type outputs=outputs}}> {
- const self = this as {{contractName}}Contract;
- const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(txData);
- const returnValue = await self._web3ContractInstance.{{this.name}}.call(
- {{> params inputs=inputs}}
- txDataWithDefaults,
- );
- return returnValue;
- },
-};
diff --git a/packages/contracts/contract_templates/partials/typed_params.handlebars b/packages/contracts/contract_templates/partials/typed_params.handlebars
deleted file mode 100644
index c100e58f7..000000000
--- a/packages/contracts/contract_templates/partials/typed_params.handlebars
+++ /dev/null
@@ -1,3 +0,0 @@
-{{#each inputs}}
- {{name}}: {{#parameterType type components}}{{/parameterType}},
-{{/each}}