prettify generated code for easier diffing (#1944)
This commit is contained in:
parent
3a0b0c0973
commit
ccb89fb26a
@ -24,12 +24,7 @@ lib
|
|||||||
/contracts/exchange-forwarder/generated-artifacts
|
/contracts/exchange-forwarder/generated-artifacts
|
||||||
/contracts/dev-utils/generated-wrappers
|
/contracts/dev-utils/generated-wrappers
|
||||||
/contracts/dev-utils/generated-artifacts
|
/contracts/dev-utils/generated-artifacts
|
||||||
/packages/abi-gen/test-cli/fixtures/artifacts/
|
|
||||||
/packages/abi-gen/test-cli/output
|
/packages/abi-gen/test-cli/output
|
||||||
/packages/abi-gen/test-cli/expected-output
|
|
||||||
/packages/abi-gen-wrappers/src/generated-wrappers
|
|
||||||
/packages/contract-artifacts/artifacts
|
|
||||||
/python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts
|
|
||||||
/packages/json-schemas/schemas
|
/packages/json-schemas/schemas
|
||||||
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
/python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||||
/packages/metacoin/src/contract_wrappers
|
/packages/metacoin/src/contract_wrappers
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
"build:ci": "yarn build",
|
"build:ci": "yarn build",
|
||||||
"lint": "tslint --format stylish --project .",
|
"lint": "tslint --format stylish --project .",
|
||||||
"fix": "tslint --fix --format stylish --project .",
|
"fix": "tslint --fix --format stylish --project .",
|
||||||
"pre_build": "yarn generate_contract_wrappers",
|
"pre_build": "yarn generate_contract_wrappers && yarn prettier_contract_wrappers",
|
||||||
"prettier": "prettier --write src/**/* --config ../../.prettierrc",
|
"prettier": "prettier --write src/**/* --config ../../.prettierrc",
|
||||||
|
"prettier_contract_wrappers": "prettier --write src/generated-wrappers/* --config ../../.prettierrc",
|
||||||
"clean": "shx rm -rf lib src/generated-wrappers",
|
"clean": "shx rm -rf lib src/generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"lint-contracts": "solhint -c ../../contracts/.solhint.json test-cli/contracts/*.sol",
|
"lint-contracts": "solhint -c ../../contracts/.solhint.json test-cli/contracts/*.sol",
|
||||||
"fix": "tslint --fix --format stylish --project . && yarn lint-contracts",
|
"fix": "tslint --fix --format stylish --project . && yarn lint-contracts",
|
||||||
"clean": "shx rm -rf lib && yarn test_cli:clean",
|
"clean": "shx rm -rf lib && yarn test_cli:clean",
|
||||||
"build": "tsc -b && yarn generate_contract_wrappers && yarn test_cli:build",
|
"build": "tsc -b && yarn generate_contract_wrappers && yarn prettier_contract_wrappers && yarn test_cli:build",
|
||||||
"build:ci": "yarn build",
|
"build:ci": "yarn build",
|
||||||
"test": "yarn run_mocha && yarn test_cli",
|
"test": "yarn run_mocha && yarn test_cli",
|
||||||
"test:circleci": "yarn test:coverage && yarn test_cli",
|
"test:circleci": "yarn test:coverage && yarn test_cli",
|
||||||
@ -29,6 +29,7 @@
|
|||||||
"clean:sol": "rm -rf test-cli/artifacts",
|
"clean:sol": "rm -rf test-cli/artifacts",
|
||||||
"compile:sol": "sol-compiler",
|
"compile:sol": "sol-compiler",
|
||||||
"watch:sol": "sol-compiler -w",
|
"watch:sol": "sol-compiler -w",
|
||||||
|
"prettier_contract_wrappers": "prettier --write ./test-cli/output/typescript/* --config ../../.prettierrc",
|
||||||
"generate_contract_wrappers": "run-p gen_typescript gen_python",
|
"generate_contract_wrappers": "run-p gen_typescript gen_python",
|
||||||
"gen_typescript": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output ./test-cli/output/typescript --backend ethers",
|
"gen_typescript": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output ./test-cli/output/typescript --backend ethers",
|
||||||
"gen_python": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/Python/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/Python/partials/**/*.handlebars' --output ./test-cli/output/python --language Python",
|
"gen_python": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/Python/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/Python/partials/**/*.handlebars' --output ./test-cli/output/python --language Python",
|
||||||
|
@ -23,17 +23,12 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
export class AbiGenDummyContract extends BaseContract {
|
export class AbiGenDummyContract extends BaseContract {
|
||||||
public simpleRequire = {
|
public simpleRequire = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<void
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -42,7 +37,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('simpleRequire()', []);
|
const encodedData = self._strictEncodeArguments('simpleRequire()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -56,14 +51,12 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('simpleRequire()');
|
const abiEncoder = self._lookupAbiEncoder('simpleRequire()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void
|
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const self = this as any as AbiGenDummyContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('simpleRequire()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('simpleRequire()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
@ -71,13 +64,12 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
public ecrecoverFn = {
|
public ecrecoverFn = {
|
||||||
async callAsync(
|
async callAsync(
|
||||||
hash: string,
|
hash: string,
|
||||||
v: number|BigNumber,
|
v: number | BigNumber,
|
||||||
r: string,
|
r: string,
|
||||||
s: string,
|
s: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<string
|
): Promise<string> {
|
||||||
> {
|
|
||||||
assert.isString('hash', hash);
|
assert.isString('hash', hash);
|
||||||
assert.isNumberOrBigNumber('v', v);
|
assert.isNumberOrBigNumber('v', v);
|
||||||
assert.isString('r', r);
|
assert.isString('r', r);
|
||||||
@ -90,12 +82,13 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('ecrecoverFn(bytes32,uint8,bytes32,bytes32)', [hash,
|
const encodedData = self._strictEncodeArguments('ecrecoverFn(bytes32,uint8,bytes32,bytes32)', [
|
||||||
v,
|
hash,
|
||||||
r,
|
v,
|
||||||
s
|
r,
|
||||||
]);
|
s,
|
||||||
|
]);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -108,36 +101,25 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('ecrecoverFn(bytes32,uint8,bytes32,bytes32)');
|
const abiEncoder = self._lookupAbiEncoder('ecrecoverFn(bytes32,uint8,bytes32,bytes32)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<string
|
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(hash: string, v: number | BigNumber, r: string, s: string): string {
|
||||||
hash: string,
|
|
||||||
v: number|BigNumber,
|
|
||||||
r: string,
|
|
||||||
s: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('hash', hash);
|
assert.isString('hash', hash);
|
||||||
assert.isNumberOrBigNumber('v', v);
|
assert.isNumberOrBigNumber('v', v);
|
||||||
assert.isString('r', r);
|
assert.isString('r', r);
|
||||||
assert.isString('s', s);
|
assert.isString('s', s);
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('ecrecoverFn(bytes32,uint8,bytes32,bytes32)', [hash,
|
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||||
v,
|
'ecrecoverFn(bytes32,uint8,bytes32,bytes32)',
|
||||||
r,
|
[hash, v, r, s],
|
||||||
s
|
);
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public revertWithConstant = {
|
public revertWithConstant = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<void
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -146,7 +128,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('revertWithConstant()', []);
|
const encodedData = self._strictEncodeArguments('revertWithConstant()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -160,24 +142,18 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('revertWithConstant()');
|
const abiEncoder = self._lookupAbiEncoder('revertWithConstant()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void
|
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const self = this as any as AbiGenDummyContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('revertWithConstant()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('revertWithConstant()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public simpleRevert = {
|
public simpleRevert = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<void
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -186,7 +162,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('simpleRevert()', []);
|
const encodedData = self._strictEncodeArguments('simpleRevert()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -200,24 +176,18 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('simpleRevert()');
|
const abiEncoder = self._lookupAbiEncoder('simpleRevert()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void
|
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const self = this as any as AbiGenDummyContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('simpleRevert()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('simpleRevert()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public requireWithConstant = {
|
public requireWithConstant = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<void
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -226,7 +196,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('requireWithConstant()', []);
|
const encodedData = self._strictEncodeArguments('requireWithConstant()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -240,25 +210,18 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('requireWithConstant()');
|
const abiEncoder = self._lookupAbiEncoder('requireWithConstant()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void
|
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const self = this as any as AbiGenDummyContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('requireWithConstant()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('requireWithConstant()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public simplePureFunctionWithInput = {
|
public simplePureFunctionWithInput = {
|
||||||
async callAsync(
|
async callAsync(x: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||||
x: BigNumber,
|
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<BigNumber
|
|
||||||
> {
|
|
||||||
assert.isBigNumber('x', x);
|
assert.isBigNumber('x', x);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -268,9 +231,8 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x
|
const encodedData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -283,27 +245,19 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('simplePureFunctionWithInput(uint256)');
|
const abiEncoder = self._lookupAbiEncoder('simplePureFunctionWithInput(uint256)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(x: BigNumber): string {
|
||||||
x: BigNumber,
|
|
||||||
): string {
|
|
||||||
assert.isBigNumber('x', x);
|
assert.isBigNumber('x', x);
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x
|
const abiEncodedTransactionData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x]);
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public simplePureFunction = {
|
public simplePureFunction = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<BigNumber
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -312,7 +266,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('simplePureFunction()', []);
|
const encodedData = self._strictEncodeArguments('simplePureFunction()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -326,24 +280,18 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('simplePureFunction()');
|
const abiEncoder = self._lookupAbiEncoder('simplePureFunction()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const self = this as any as AbiGenDummyContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('simplePureFunction()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('simplePureFunction()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public pureFunctionWithConstant = {
|
public pureFunctionWithConstant = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<BigNumber
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -352,7 +300,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as AbiGenDummyContract;
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('pureFunctionWithConstant()', []);
|
const encodedData = self._strictEncodeArguments('pureFunctionWithConstant()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -366,14 +314,12 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('pureFunctionWithConstant()');
|
const abiEncoder = self._lookupAbiEncoder('pureFunctionWithConstant()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as AbiGenDummyContract;
|
||||||
const self = this as any as AbiGenDummyContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('pureFunctionWithConstant()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('pureFunctionWithConstant()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
@ -394,7 +340,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -410,17 +356,13 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -433,45 +375,38 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns The contract ABI
|
* @returns The contract ABI
|
||||||
*/
|
*/
|
||||||
public static ABI(): ContractAbi {
|
public static ABI(): ContractAbi {
|
||||||
const abi = [
|
const abi = [
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [],
|
||||||
],
|
|
||||||
name: 'simpleRequire',
|
name: 'simpleRequire',
|
||||||
outputs: [
|
outputs: [],
|
||||||
],
|
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
name: 'hash',
|
name: 'hash',
|
||||||
type: 'bytes32',
|
type: 'bytes32',
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'v',
|
name: 'v',
|
||||||
type: 'uint8',
|
type: 'uint8',
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'r',
|
name: 'r',
|
||||||
type: 'bytes32',
|
type: 'bytes32',
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 's',
|
name: 's',
|
||||||
type: 'bytes32',
|
type: 'bytes32',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: 'ecrecoverFn',
|
name: 'ecrecoverFn',
|
||||||
@ -479,53 +414,45 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
{
|
{
|
||||||
name: 'signerAddress',
|
name: 'signerAddress',
|
||||||
type: 'address',
|
type: 'address',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [],
|
||||||
],
|
|
||||||
name: 'revertWithConstant',
|
name: 'revertWithConstant',
|
||||||
outputs: [
|
outputs: [],
|
||||||
],
|
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [],
|
||||||
],
|
|
||||||
name: 'simpleRevert',
|
name: 'simpleRevert',
|
||||||
outputs: [
|
outputs: [],
|
||||||
],
|
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [],
|
||||||
],
|
|
||||||
name: 'requireWithConstant',
|
name: 'requireWithConstant',
|
||||||
outputs: [
|
outputs: [],
|
||||||
],
|
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
name: 'x',
|
name: 'x',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: 'simplePureFunctionWithInput',
|
name: 'simplePureFunctionWithInput',
|
||||||
@ -533,39 +460,34 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
{
|
{
|
||||||
name: 'sum',
|
name: 'sum',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [],
|
||||||
],
|
|
||||||
name: 'simplePureFunction',
|
name: 'simplePureFunction',
|
||||||
outputs: [
|
outputs: [
|
||||||
{
|
{
|
||||||
name: 'result',
|
name: 'result',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [],
|
||||||
],
|
|
||||||
name: 'pureFunctionWithConstant',
|
name: 'pureFunctionWithConstant',
|
||||||
outputs: [
|
outputs: [
|
||||||
{
|
{
|
||||||
name: 'someConstant',
|
name: 'someConstant',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payable: false,
|
payable: false,
|
||||||
@ -579,7 +501,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
super('AbiGenDummy', AbiGenDummyContract.ABI(), address, supportedProvider, txDefaults);
|
super('AbiGenDummy', AbiGenDummyContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable:max-file-line-count
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
|
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
@ -44,7 +43,7 @@ export class LibDummyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -60,17 +59,13 @@ export class LibDummyContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -83,20 +78,18 @@ export class LibDummyContract extends BaseContract {
|
|||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns The contract ABI
|
* @returns The contract ABI
|
||||||
*/
|
*/
|
||||||
public static ABI(): ContractAbi {
|
public static ABI(): ContractAbi {
|
||||||
const abi = [
|
const abi = [] as ContractAbi;
|
||||||
] as ContractAbi;
|
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
super('LibDummy', LibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
super('LibDummy', LibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable:max-file-line-count
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
|
@ -23,18 +23,12 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
export class TestLibDummyContract extends BaseContract {
|
export class TestLibDummyContract extends BaseContract {
|
||||||
public publicAddConstant = {
|
public publicAddConstant = {
|
||||||
async callAsync(
|
async callAsync(x: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||||
x: BigNumber,
|
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<BigNumber
|
|
||||||
> {
|
|
||||||
assert.isBigNumber('x', x);
|
assert.isBigNumber('x', x);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -44,9 +38,8 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as TestLibDummyContract;
|
const self = (this as any) as TestLibDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('publicAddConstant(uint256)', [x
|
const encodedData = self._strictEncodeArguments('publicAddConstant(uint256)', [x]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -59,28 +52,19 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('publicAddConstant(uint256)');
|
const abiEncoder = self._lookupAbiEncoder('publicAddConstant(uint256)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(x: BigNumber): string {
|
||||||
x: BigNumber,
|
|
||||||
): string {
|
|
||||||
assert.isBigNumber('x', x);
|
assert.isBigNumber('x', x);
|
||||||
const self = this as any as TestLibDummyContract;
|
const self = (this as any) as TestLibDummyContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('publicAddConstant(uint256)', [x
|
const abiEncodedTransactionData = self._strictEncodeArguments('publicAddConstant(uint256)', [x]);
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public publicAddOne = {
|
public publicAddOne = {
|
||||||
async callAsync(
|
async callAsync(x: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||||
x: BigNumber,
|
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<BigNumber
|
|
||||||
> {
|
|
||||||
assert.isBigNumber('x', x);
|
assert.isBigNumber('x', x);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -90,9 +74,8 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as TestLibDummyContract;
|
const self = (this as any) as TestLibDummyContract;
|
||||||
const encodedData = self._strictEncodeArguments('publicAddOne(uint256)', [x
|
const encodedData = self._strictEncodeArguments('publicAddOne(uint256)', [x]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -105,18 +88,14 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('publicAddOne(uint256)');
|
const abiEncoder = self._lookupAbiEncoder('publicAddOne(uint256)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(x: BigNumber): string {
|
||||||
x: BigNumber,
|
|
||||||
): string {
|
|
||||||
assert.isBigNumber('x', x);
|
assert.isBigNumber('x', x);
|
||||||
const self = this as any as TestLibDummyContract;
|
const self = (this as any) as TestLibDummyContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('publicAddOne(uint256)', [x
|
const abiEncodedTransactionData = self._strictEncodeArguments('publicAddOne(uint256)', [x]);
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -136,7 +115,7 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -152,17 +131,13 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -175,19 +150,17 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns The contract ABI
|
* @returns The contract ABI
|
||||||
*/
|
*/
|
||||||
public static ABI(): ContractAbi {
|
public static ABI(): ContractAbi {
|
||||||
const abi = [
|
const abi = [
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
name: 'x',
|
name: 'x',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: 'publicAddConstant',
|
name: 'publicAddConstant',
|
||||||
@ -195,20 +168,18 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
{
|
{
|
||||||
name: 'result',
|
name: 'result',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payable: false,
|
payable: false,
|
||||||
stateMutability: 'pure',
|
stateMutability: 'pure',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
constant: true,
|
constant: true,
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
name: 'x',
|
name: 'x',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: 'publicAddOne',
|
name: 'publicAddOne',
|
||||||
@ -216,7 +187,6 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
{
|
{
|
||||||
name: 'result',
|
name: 'result',
|
||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payable: false,
|
payable: false,
|
||||||
@ -230,7 +200,7 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
super('TestLibDummy', TestLibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
super('TestLibDummy', TestLibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable:max-file-line-count
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,60 +1,60 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": "2.0.0",
|
"schemaVersion": "2.0.0",
|
||||||
"contractName": "LibDummy",
|
"contractName": "LibDummy",
|
||||||
"compilerOutput": {
|
"compilerOutput": {
|
||||||
"abi": [],
|
"abi": [],
|
||||||
"evm": {
|
"evm": {
|
||||||
"bytecode": {
|
"bytecode": {
|
||||||
"linkReferences": {},
|
"linkReferences": {},
|
||||||
"object": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72305820a278ce8d53a26107b2f2ba78687fa040ee9ab2ecf0e44ebff0f9410c586e0c6d64736f6c634300050a0032",
|
"object": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72305820a278ce8d53a26107b2f2ba78687fa040ee9ab2ecf0e44ebff0f9410c586e0c6d64736f6c634300050a0032",
|
||||||
"opcodes": "PUSH1 0x55 PUSH1 0x23 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x16 JUMPI INVALID JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 LOG2 PUSH25 0xCE8D53A26107B2F2BA78687FA040EE9AB2ECF0E44EBFF0F941 0xc PC PUSH15 0xC6D64736F6C634300050A00320000 ",
|
"opcodes": "PUSH1 0x55 PUSH1 0x23 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x16 JUMPI INVALID JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 LOG2 PUSH25 0xCE8D53A26107B2F2BA78687FA040EE9AB2ECF0E44EBFF0F941 0xc PC PUSH15 0xC6D64736F6C634300050A00320000 ",
|
||||||
"sourceMap": "606:385:1:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24"
|
"sourceMap": "606:385:1:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24"
|
||||||
},
|
},
|
||||||
"deployedBytecode": {
|
"deployedBytecode": {
|
||||||
"linkReferences": {},
|
"linkReferences": {},
|
||||||
"object": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72305820a278ce8d53a26107b2f2ba78687fa040ee9ab2ecf0e44ebff0f9410c586e0c6d64736f6c634300050a0032",
|
"object": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72305820a278ce8d53a26107b2f2ba78687fa040ee9ab2ecf0e44ebff0f9410c586e0c6d64736f6c634300050a0032",
|
||||||
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 LOG2 PUSH25 0xCE8D53A26107B2F2BA78687FA040EE9AB2ECF0E44EBFF0F941 0xc PC PUSH15 0xC6D64736F6C634300050A00320000 ",
|
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 LOG2 PUSH25 0xCE8D53A26107B2F2BA78687FA040EE9AB2ECF0E44EBFF0F941 0xc PC PUSH15 0xC6D64736F6C634300050A00320000 ",
|
||||||
"sourceMap": "606:385:1:-;;;;;;;;"
|
"sourceMap": "606:385:1:-;;;;;;;;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sources": {
|
"sources": {
|
||||||
"LibDummy.sol": {
|
"LibDummy.sol": {
|
||||||
"id": 1
|
"id": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sourceCodes": {
|
"sourceCodes": {
|
||||||
"LibDummy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.5;\n\n\nlibrary LibDummy {\n\n using LibDummy for uint256;\n uint256 constant internal SOME_CONSTANT = 1234;\n\n function addOne (uint256 x)\n internal\n pure\n returns (uint256 sum)\n {\n return x + 1;\n }\n\n function addConstant (uint256 x)\n internal\n pure\n returns (uint256 someConstant)\n {\n return x + SOME_CONSTANT;\n }\n}\n"
|
"LibDummy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.5;\n\n\nlibrary LibDummy {\n\n using LibDummy for uint256;\n uint256 constant internal SOME_CONSTANT = 1234;\n\n function addOne (uint256 x)\n internal\n pure\n returns (uint256 sum)\n {\n return x + 1;\n }\n\n function addConstant (uint256 x)\n internal\n pure\n returns (uint256 someConstant)\n {\n return x + SOME_CONSTANT;\n }\n}\n"
|
||||||
},
|
},
|
||||||
"sourceTreeHashHex": "0xe9654f3d694bd3513dddbcc0ccd7a75739bf63dc92b974e163f191122416fdb6",
|
"sourceTreeHashHex": "0xe9654f3d694bd3513dddbcc0ccd7a75739bf63dc92b974e163f191122416fdb6",
|
||||||
"compiler": {
|
"compiler": {
|
||||||
"name": "solc",
|
"name": "solc",
|
||||||
"version": "soljson-v0.5.10+commit.5a6ea5b1.js",
|
"version": "soljson-v0.5.10+commit.5a6ea5b1.js",
|
||||||
"settings": {
|
"settings": {
|
||||||
"optimizer": {
|
"optimizer": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"runs": 1000000,
|
"runs": 1000000,
|
||||||
"details": {
|
"details": {
|
||||||
"yul": true,
|
"yul": true,
|
||||||
"deduplicate": true,
|
"deduplicate": true,
|
||||||
"cse": true,
|
"cse": true,
|
||||||
"constantOptimizer": true
|
"constantOptimizer": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputSelection": {
|
"outputSelection": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
"abi",
|
"abi",
|
||||||
"evm.bytecode.object",
|
"evm.bytecode.object",
|
||||||
"evm.bytecode.sourceMap",
|
"evm.bytecode.sourceMap",
|
||||||
"evm.deployedBytecode.object",
|
"evm.deployedBytecode.object",
|
||||||
"evm.deployedBytecode.sourceMap"
|
"evm.deployedBytecode.sourceMap"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"evmVersion": "constantinople",
|
"evmVersion": "constantinople",
|
||||||
"remappings": []
|
"remappings": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"networks": {}
|
"networks": {}
|
||||||
}
|
}
|
||||||
|
@ -1,103 +1,103 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": "2.0.0",
|
"schemaVersion": "2.0.0",
|
||||||
"contractName": "TestLibDummy",
|
"contractName": "TestLibDummy",
|
||||||
"compilerOutput": {
|
"compilerOutput": {
|
||||||
"abi": [
|
"abi": [
|
||||||
{
|
{
|
||||||
"constant": true,
|
"constant": true,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"name": "x",
|
"name": "x",
|
||||||
"type": "uint256"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "publicAddConstant",
|
"name": "publicAddConstant",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"name": "result",
|
"name": "result",
|
||||||
"type": "uint256"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"stateMutability": "pure",
|
"stateMutability": "pure",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"constant": true,
|
"constant": true,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"name": "x",
|
"name": "x",
|
||||||
"type": "uint256"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "publicAddOne",
|
"name": "publicAddOne",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"name": "result",
|
"name": "result",
|
||||||
"type": "uint256"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"stateMutability": "pure",
|
"stateMutability": "pure",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"evm": {
|
"evm": {
|
||||||
"bytecode": {
|
"bytecode": {
|
||||||
"linkReferences": {},
|
"linkReferences": {},
|
||||||
"object": "0x608060405234801561001057600080fd5b5060d78061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806322935e921460375780632b82fdf0146063575b600080fd5b605160048036036020811015604b57600080fd5b5035607d565b60408051918252519081900360200190f35b605160048036036020811015607757600080fd5b5035608c565b60006086826095565b92915050565b6000608682609c565b6104d20190565b6001019056fea265627a7a72305820c97345939b2d163165dee7bdfbbd7ca281c5bdaea7b03de53b0ceb32b097cdf864736f6c634300050a0032",
|
"object": "0x608060405234801561001057600080fd5b5060d78061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806322935e921460375780632b82fdf0146063575b600080fd5b605160048036036020811015604b57600080fd5b5035607d565b60408051918252519081900360200190f35b605160048036036020811015607757600080fd5b5035608c565b60006086826095565b92915050565b6000608682609c565b6104d20190565b6001019056fea265627a7a72305820c97345939b2d163165dee7bdfbbd7ca281c5bdaea7b03de53b0ceb32b097cdf864736f6c634300050a0032",
|
||||||
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xD7 DUP1 PUSH2 0x1F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x22935E92 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0x2B82FDF0 EQ PUSH1 0x63 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x4B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x7D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x77 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x8C JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x95 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x9C JUMP JUMPDEST PUSH2 0x4D2 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 ADD SWAP1 JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0xc9 PUSH20 0x45939B2D163165DEE7BDFBBD7CA281C5BDAEA7B0 RETURNDATASIZE 0xe5 EXTCODESIZE 0xc 0xeb ORIGIN 0xb0 SWAP8 0xcd 0xf8 PUSH5 0x736F6C6343 STOP SDIV EXP STOP ORIGIN ",
|
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xD7 DUP1 PUSH2 0x1F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x22935E92 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0x2B82FDF0 EQ PUSH1 0x63 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x4B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x7D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x77 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x8C JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x95 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x9C JUMP JUMPDEST PUSH2 0x4D2 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 ADD SWAP1 JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0xc9 PUSH20 0x45939B2D163165DEE7BDFBBD7CA281C5BDAEA7B0 RETURNDATASIZE 0xe5 EXTCODESIZE 0xc 0xeb ORIGIN 0xb0 SWAP8 0xcd 0xf8 PUSH5 0x736F6C6343 STOP SDIV EXP STOP ORIGIN ",
|
||||||
"sourceMap": "632:346:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;632:346:2;;;;;;;"
|
"sourceMap": "632:346:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;632:346:2;;;;;;;"
|
||||||
},
|
},
|
||||||
"deployedBytecode": {
|
"deployedBytecode": {
|
||||||
"linkReferences": {},
|
"linkReferences": {},
|
||||||
"object": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c806322935e921460375780632b82fdf0146063575b600080fd5b605160048036036020811015604b57600080fd5b5035607d565b60408051918252519081900360200190f35b605160048036036020811015607757600080fd5b5035608c565b60006086826095565b92915050565b6000608682609c565b6104d20190565b6001019056fea265627a7a72305820c97345939b2d163165dee7bdfbbd7ca281c5bdaea7b03de53b0ceb32b097cdf864736f6c634300050a0032",
|
"object": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c806322935e921460375780632b82fdf0146063575b600080fd5b605160048036036020811015604b57600080fd5b5035607d565b60408051918252519081900360200190f35b605160048036036020811015607757600080fd5b5035608c565b60006086826095565b92915050565b6000608682609c565b6104d20190565b6001019056fea265627a7a72305820c97345939b2d163165dee7bdfbbd7ca281c5bdaea7b03de53b0ceb32b097cdf864736f6c634300050a0032",
|
||||||
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x22935E92 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0x2B82FDF0 EQ PUSH1 0x63 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x4B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x7D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x77 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x8C JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x95 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x9C JUMP JUMPDEST PUSH2 0x4D2 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 ADD SWAP1 JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0xc9 PUSH20 0x45939B2D163165DEE7BDFBBD7CA281C5BDAEA7B0 RETURNDATASIZE 0xe5 EXTCODESIZE 0xc 0xeb ORIGIN 0xb0 SWAP8 0xcd 0xf8 PUSH5 0x736F6C6343 STOP SDIV EXP STOP ORIGIN ",
|
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x32 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x22935E92 EQ PUSH1 0x37 JUMPI DUP1 PUSH4 0x2B82FDF0 EQ PUSH1 0x63 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x4B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x7D JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x51 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH1 0x77 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH1 0x8C JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x95 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x86 DUP3 PUSH1 0x9C JUMP JUMPDEST PUSH2 0x4D2 ADD SWAP1 JUMP JUMPDEST PUSH1 0x1 ADD SWAP1 JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0xc9 PUSH20 0x45939B2D163165DEE7BDFBBD7CA281C5BDAEA7B0 RETURNDATASIZE 0xe5 EXTCODESIZE 0xc 0xeb ORIGIN 0xb0 SWAP8 0xcd 0xf8 PUSH5 0x736F6C6343 STOP SDIV EXP STOP ORIGIN ",
|
||||||
"sourceMap": "632:346:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;632:346:2;;;;;;;;;;;;;;;;;;;;;;;;833:143;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;833:143:2;;:::i;:::-;;;;;;;;;;;;;;;;694:133;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;694:133:2;;:::i;833:143::-;917:14;954:15;:1;:13;:15::i;:::-;947:22;833:143;-1:-1:-1;;833:143:2:o;694:133::-;773:14;810:10;:1;:8;:10::i;842:147:1:-;704:4;965:17;;842:147::o;715:121::-;828:1;824:5;;715:121::o"
|
"sourceMap": "632:346:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;632:346:2;;;;;;;;;;;;;;;;;;;;;;;;833:143;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;833:143:2;;:::i;:::-;;;;;;;;;;;;;;;;694:133;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;694:133:2;;:::i;833:143::-;917:14;954:15;:1;:13;:15::i;:::-;947:22;833:143;-1:-1:-1;;833:143:2:o;694:133::-;773:14;810:10;:1;:8;:10::i;842:147:1:-;704:4;965:17;;842:147::o;715:121::-;828:1;824:5;;715:121::o"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sources": {
|
"sources": {
|
||||||
"TestLibDummy.sol": {
|
"TestLibDummy.sol": {
|
||||||
"id": 2
|
"id": 2
|
||||||
},
|
},
|
||||||
"LibDummy.sol": {
|
"LibDummy.sol": {
|
||||||
"id": 1
|
"id": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sourceCodes": {
|
"sourceCodes": {
|
||||||
"TestLibDummy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.5;\n\nimport \"./LibDummy.sol\";\n\n\ncontract TestLibDummy {\n\n using LibDummy for uint256;\n\n function publicAddOne (uint256 x)\n public\n pure\n returns (uint256 result)\n {\n return x.addOne();\n }\n\n function publicAddConstant (uint256 x)\n public\n pure\n returns (uint256 result)\n {\n return x.addConstant();\n }\n}\n",
|
"TestLibDummy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.5;\n\nimport \"./LibDummy.sol\";\n\n\ncontract TestLibDummy {\n\n using LibDummy for uint256;\n\n function publicAddOne (uint256 x)\n public\n pure\n returns (uint256 result)\n {\n return x.addOne();\n }\n\n function publicAddConstant (uint256 x)\n public\n pure\n returns (uint256 result)\n {\n return x.addConstant();\n }\n}\n",
|
||||||
"LibDummy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.5;\n\n\nlibrary LibDummy {\n\n using LibDummy for uint256;\n uint256 constant internal SOME_CONSTANT = 1234;\n\n function addOne (uint256 x)\n internal\n pure\n returns (uint256 sum)\n {\n return x + 1;\n }\n\n function addConstant (uint256 x)\n internal\n pure\n returns (uint256 someConstant)\n {\n return x + SOME_CONSTANT;\n }\n}\n"
|
"LibDummy.sol": "/*\n\n Copyright 2018 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.5;\n\n\nlibrary LibDummy {\n\n using LibDummy for uint256;\n uint256 constant internal SOME_CONSTANT = 1234;\n\n function addOne (uint256 x)\n internal\n pure\n returns (uint256 sum)\n {\n return x + 1;\n }\n\n function addConstant (uint256 x)\n internal\n pure\n returns (uint256 someConstant)\n {\n return x + SOME_CONSTANT;\n }\n}\n"
|
||||||
},
|
},
|
||||||
"sourceTreeHashHex": "0xca99c7d7de9db975842de61e6ec01debdada66cf91d28fc3f2983de3011560dc",
|
"sourceTreeHashHex": "0xca99c7d7de9db975842de61e6ec01debdada66cf91d28fc3f2983de3011560dc",
|
||||||
"compiler": {
|
"compiler": {
|
||||||
"name": "solc",
|
"name": "solc",
|
||||||
"version": "soljson-v0.5.10+commit.5a6ea5b1.js",
|
"version": "soljson-v0.5.10+commit.5a6ea5b1.js",
|
||||||
"settings": {
|
"settings": {
|
||||||
"optimizer": {
|
"optimizer": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"runs": 1000000,
|
"runs": 1000000,
|
||||||
"details": {
|
"details": {
|
||||||
"yul": true,
|
"yul": true,
|
||||||
"deduplicate": true,
|
"deduplicate": true,
|
||||||
"cse": true,
|
"cse": true,
|
||||||
"constantOptimizer": true
|
"constantOptimizer": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputSelection": {
|
"outputSelection": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
"abi",
|
"abi",
|
||||||
"evm.bytecode.object",
|
"evm.bytecode.object",
|
||||||
"evm.bytecode.sourceMap",
|
"evm.bytecode.sourceMap",
|
||||||
"evm.deployedBytecode.object",
|
"evm.deployedBytecode.object",
|
||||||
"evm.deployedBytecode.sourceMap"
|
"evm.deployedBytecode.sourceMap"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"evmVersion": "constantinople",
|
"evmVersion": "constantinople",
|
||||||
"remappings": []
|
"remappings": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"networks": {}
|
"networks": {}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user