From 1a31ceff8ef021d1795fb1d95613340872321504 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 14:56:11 +0200 Subject: Run linter sequentially --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a550c3f58..2ef256785 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "rebuild": "run-s clean build", "test": "wsrun test $PKG --serial --exclude-missing", "stage_docs": "wsrun docs:stage $PKG --parallel --exclude-missing", - "lint": "wsrun lint $PKG --parallel --exclude-missing" + "lint": "wsrun lint $PKG --exclude-missing" }, "config": { "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic" -- cgit v1.2.3 From f49d432fdc6e0cbe5cca574159e7e2f857daa542 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 14:57:28 +0200 Subject: Implement custom no-magic-numbers rule that doesn't include magic numbers passed into BigNumber instantiations (e.g const amount = new BigNumber(5); ) --- packages/tslint-config/package.json | 3 +- .../rules/customNoMagicNumbersRule.ts | 76 ++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 packages/tslint-config/rules/customNoMagicNumbersRule.ts diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 04e1ba2b6..33132210c 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -41,7 +41,8 @@ "lodash": "^4.17.4", "tslint": "5.8.0", "tslint-eslint-rules": "^4.1.1", - "tslint-react": "^3.2.0" + "tslint-react": "^3.2.0", + "tsutils": "^2.12.1" }, "publishConfig": { "access": "public" diff --git a/packages/tslint-config/rules/customNoMagicNumbersRule.ts b/packages/tslint-config/rules/customNoMagicNumbersRule.ts new file mode 100644 index 000000000..e358221eb --- /dev/null +++ b/packages/tslint-config/rules/customNoMagicNumbersRule.ts @@ -0,0 +1,76 @@ +import * as Lint from 'tslint'; +import { isPrefixUnaryExpression } from 'tsutils'; +import * as ts from 'typescript'; + +/** + * A modified version of the no-magic-numbers rule that allows for magic numbers + * when instantiating a BigNumber instance. + * E.g We want to be able to write: + * const amount = new BigNumber(5); + * Original source: https://github.com/palantir/tslint/blob/42b058a6baa688f8be8558b277eb056c3ff79818/src/rules/noMagicNumbersRule.ts + */ +export class Rule extends Lint.Rules.AbstractRule { + public static ALLOWED_NODES = new Set([ + ts.SyntaxKind.ExportAssignment, + ts.SyntaxKind.FirstAssignment, + ts.SyntaxKind.LastAssignment, + ts.SyntaxKind.PropertyAssignment, + ts.SyntaxKind.ShorthandPropertyAssignment, + ts.SyntaxKind.VariableDeclaration, + ts.SyntaxKind.VariableDeclarationList, + ts.SyntaxKind.EnumMember, + ts.SyntaxKind.PropertyDeclaration, + ts.SyntaxKind.Parameter, + ]); + + public static DEFAULT_ALLOWED = [-1, 0, 1]; + + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + const allowedNumbers = this.ruleArguments.length > 0 ? this.ruleArguments : Rule.DEFAULT_ALLOWED; + return this.applyWithWalker( + new CustomNoMagicNumbersWalker(sourceFile, this.ruleName, new Set(allowedNumbers.map(String))), + ); + } +} + +// tslint:disable-next-line:max-classes-per-file +class CustomNoMagicNumbersWalker extends Lint.AbstractWalker> { + public static FAILURE_STRING = "'magic numbers' are not allowed"; + private static _isNegativeNumberLiteral( + node: ts.Node, + ): node is ts.PrefixUnaryExpression & { operand: ts.NumericLiteral } { + return ( + isPrefixUnaryExpression(node) && + node.operator === ts.SyntaxKind.MinusToken && + node.operand.kind === ts.SyntaxKind.NumericLiteral + ); + } + public walk(sourceFile: ts.SourceFile): void { + const cb = (node: ts.Node): void => { + if (node.kind === ts.SyntaxKind.NumericLiteral) { + return this.checkNumericLiteral(node, (node as ts.NumericLiteral).text); + } + if (CustomNoMagicNumbersWalker._isNegativeNumberLiteral(node)) { + return this.checkNumericLiteral(node, `-${(node.operand as ts.NumericLiteral).text}`); + } + return ts.forEachChild(node, cb); + }; + return ts.forEachChild(sourceFile, cb); + } + + // tslint:disable:no-non-null-assertion + // tslint:disable-next-line:underscore-private-and-protected + private checkNumericLiteral(node: ts.Node, num: string): void { + if (!Rule.ALLOWED_NODES.has(node.parent!.kind) && !this.options.has(num)) { + if (node.parent!.kind === ts.SyntaxKind.NewExpression) { + const className = (node.parent! as any).expression.escapedText; + const BIG_NUMBER_NEW_EXPRESSION = 'BigNumber'; + if (className === BIG_NUMBER_NEW_EXPRESSION) { + return; // noop + } + } + this.addFailureAtNode(node, CustomNoMagicNumbersWalker.FAILURE_STRING); + } + } + // tslint:enable:no-non-null-assertion +} -- cgit v1.2.3 From 45fa26dc6cf48d8b8baf123429f0b64ad0a431c9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 14:58:01 +0200 Subject: Implement boolean variable naming custom TSLint rule --- packages/tslint-config/rules/booleanNamingRule.ts | 69 +++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 packages/tslint-config/rules/booleanNamingRule.ts diff --git a/packages/tslint-config/rules/booleanNamingRule.ts b/packages/tslint-config/rules/booleanNamingRule.ts new file mode 100644 index 000000000..bc0b42e71 --- /dev/null +++ b/packages/tslint-config/rules/booleanNamingRule.ts @@ -0,0 +1,69 @@ +import * as _ from 'lodash'; +import * as Lint from 'tslint'; +import * as ts from 'typescript'; + +const VALID_BOOLEAN_PREFIXES = ['is', 'does', 'should', 'was', 'has', 'can', 'did', 'would']; + +export class Rule extends Lint.Rules.TypedRule { + public static FAILURE_STRING = `Boolean variable names should begin with: ${VALID_BOOLEAN_PREFIXES.join(', ')}`; + + public applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program): Lint.RuleFailure[] { + return this.applyWithFunction(sourceFile, walk, undefined, program.getTypeChecker()); + } +} + +function walk(ctx: Lint.WalkContext, tc: ts.TypeChecker): void { + traverse(ctx.sourceFile); + + function traverse(node: ts.Node): void { + checkNodeForViolations(ctx, node, tc); + return ts.forEachChild(node, traverse); + } +} + +function checkNodeForViolations(ctx: Lint.WalkContext, node: ts.Node, tc: ts.TypeChecker): void { + switch (node.kind) { + // Handle: const { timestamp } = ... + case ts.SyntaxKind.BindingElement: { + const bindingElementNode = node as ts.BindingElement; + if (bindingElementNode.name.kind === ts.SyntaxKind.Identifier) { + handleBooleanNaming(bindingElementNode, tc, ctx); + } + break; + } + + // Handle regular assignments: const block = ... + case ts.SyntaxKind.VariableDeclaration: + const variableDeclarationNode = node as ts.VariableDeclaration; + if (variableDeclarationNode.name.kind === ts.SyntaxKind.Identifier) { + handleBooleanNaming(node as ts.VariableDeclaration, tc, ctx); + } + break; + + default: + // noop + } +} + +function handleBooleanNaming( + node: ts.VariableDeclaration | ts.BindingElement, + tc: ts.TypeChecker, + ctx: Lint.WalkContext, +): void { + const nodeName = node.name; + const variableName = nodeName.getText(); + const lowercasedName = _.toLower(variableName); + // tslint:disable-next-line + const typeNode = tc.getTypeAtLocation(node); + const typeName = (typeNode as any).intrinsicName; + if (typeName === 'boolean') { + const hasProperName = !_.isUndefined( + _.find(VALID_BOOLEAN_PREFIXES, prefix => { + return _.startsWith(lowercasedName, prefix); + }), + ); + if (!hasProperName) { + ctx.addFailureAtNode(node, Rule.FAILURE_STRING); + } + } +} -- cgit v1.2.3 From fec6ac3ff0c4781cea0b3f42e287aee2b8aa2a79 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 14:58:28 +0200 Subject: Enforce new rules, including no-switch-case-fall-through --- packages/tslint-config/tslint.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json index 1d717430d..77a1f41cc 100644 --- a/packages/tslint-config/tslint.json +++ b/packages/tslint-config/tslint.json @@ -5,7 +5,10 @@ "arrow-parens": [true, "ban-single-arg-parens"], "arrow-return-shorthand": true, "async-suffix": true, + "boolean-naming": true, + "no-switch-case-fall-through": true, "await-promise": true, + "custom-no-magic-numbers": [true, 0, 1, 2, 3, -1], "binary-expression-operand-order": true, "callable-types": true, "class-name": true, -- cgit v1.2.3 From 839db68571037f6fff8273aaade6ea0bd14ea8a5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 14:59:10 +0200 Subject: Fix TSLint rules --- .../zero_ex_public_network_config_schema.ts | 16 ++++++++++- packages/0x.js/test/global_hooks.ts | 3 +- packages/assert/test/assert_test.ts | 2 ++ ...ntract_wrappers_public_network_config_schema.ts | 16 ++++++++++- packages/contract-wrappers/src/utils/constants.ts | 1 + .../contract-wrappers/src/utils/filter_utils.ts | 8 +++--- packages/contract-wrappers/src/utils/utils.ts | 3 +- .../test/ether_token_wrapper_test.ts | 4 +-- packages/contract-wrappers/test/global_hooks.ts | 3 +- .../test/order_validation_test.ts | 17 +++++++---- packages/contracts/test/exchange/helpers.ts | 8 +++--- .../contracts/test/unlimited_allowance_token.ts | 4 +-- packages/contracts/test/zrx_token.ts | 4 +-- packages/contracts/tslint.json | 5 +++- packages/json-schemas/test/schema_test.ts | 11 ++++++-- packages/migrations/src/migration.ts | 5 ++-- packages/monorepo-scripts/src/postpublish_utils.ts | 1 + packages/monorepo-scripts/src/publish.ts | 4 +-- packages/order-utils/src/order_hash.ts | 3 +- packages/order-utils/src/signature_utils.ts | 17 ++++++++--- packages/order-utils/test/signature_utils_test.ts | 12 +++++--- .../src/order_watcher/order_watcher.ts | 4 ++- packages/order-watcher/src/utils/utils.ts | 3 +- .../order-watcher/test/expiration_watcher_test.ts | 33 +++++++++++++++------- packages/order-watcher/test/global_hooks.ts | 3 +- packages/order-watcher/test/order_watcher_test.ts | 4 +-- packages/react-docs/src/docs_info.ts | 4 +-- packages/react-docs/tslint.json | 3 +- packages/react-shared/tslint.json | 3 +- packages/sol-compiler/src/compiler.ts | 3 +- packages/sol-compiler/test/compiler_test.ts | 8 ++++-- .../sol-cov/test/collect_coverage_entries_test.ts | 7 +++-- packages/sol-cov/test/instructions_test.ts | 1 + packages/sra-report/src/index.ts | 13 ++++++++- .../sra-report/src/postman_environment_factory.ts | 14 ++++++--- packages/sra-report/test/test_runner.ts | 11 ++++---- packages/subproviders/src/subproviders/ledger.ts | 18 ++++++++---- .../subproviders/src/subproviders/nonce_tracker.ts | 3 +- .../subproviders/src/subproviders/subprovider.ts | 5 ++-- packages/subproviders/src/utils/wallet_utils.ts | 4 +-- .../test/integration/ledger_subprovider_test.ts | 13 +++++---- .../test/unit/ledger_subprovider_test.ts | 8 ++++-- .../test/unit/mnemonic_wallet_subprovider_test.ts | 5 ++-- .../test/unit/redundant_rpc_subprovider_test.ts | 5 ++-- packages/testnet-faucets/src/ts/constants.ts | 5 ++++ packages/testnet-faucets/src/ts/handler.ts | 11 ++++---- .../src/ts/parameter_transformer.ts | 5 ++-- packages/testnet-faucets/src/ts/server.ts | 6 ++-- packages/utils/src/abi_decoder.ts | 12 ++++---- packages/utils/src/address_utils.ts | 11 ++++++-- packages/utils/src/interval_utils.ts | 8 +++--- packages/web3-wrapper/src/web3_wrapper.ts | 16 ++++++----- .../components/generate_order/new_token_form.tsx | 8 +++--- .../ts/components/relayer_index/relayer_index.tsx | 4 +-- packages/website/tslint.json | 3 +- 55 files changed, 278 insertions(+), 133 deletions(-) create mode 100644 packages/testnet-faucets/src/ts/constants.ts diff --git a/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts b/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts index 9da31481a..f7f6727f0 100644 --- a/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts +++ b/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts @@ -1,9 +1,23 @@ +const networkNameToId: { [networkName: string]: number } = { + mainnet: 1, + ropsten: 3, + rinkeby: 4, + kovan: 42, + ganache: 50, +}; + export const zeroExPublicNetworkConfigSchema = { id: '/ZeroExPublicNetworkConfig', properties: { networkId: { type: 'number', - enum: [1, 3, 4, 42, 50], + enum: [ + networkNameToId.mainnet, + networkNameToId.ropsten, + networkNameToId.rinkeby, + networkNameToId.kovan, + networkNameToId.ganache, + ], }, gasPrice: { $ref: '/Number' }, zrxContractAddress: { $ref: '/Address' }, diff --git a/packages/0x.js/test/global_hooks.ts b/packages/0x.js/test/global_hooks.ts index 53b3ef545..fa1dfae38 100644 --- a/packages/0x.js/test/global_hooks.ts +++ b/packages/0x.js/test/global_hooks.ts @@ -8,7 +8,8 @@ import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise { // HACK: Since the migrations take longer then our global mocha timeout limit // we manually increase it for this before hook. - this.timeout(20000); + const mochaTestTimeoutMs = 20000; + this.timeout(mochaTestTimeoutMs); const txDefaults = { gas: devConstants.GAS_ESTIMATE, from: devConstants.TESTRPC_FIRST_ADDRESS, diff --git a/packages/assert/test/assert_test.ts b/packages/assert/test/assert_test.ts index 1d9a34ed9..15fd3e6a8 100644 --- a/packages/assert/test/assert_test.ts +++ b/packages/assert/test/assert_test.ts @@ -10,6 +10,7 @@ chai.config.includeStack = true; chai.use(dirtyChai); const expect = chai.expect; +// tslint:disable:custom-no-magic-numbers describe('Assertions', () => { const variableName = 'variable'; describe('#isBigNumber', () => { @@ -251,3 +252,4 @@ describe('Assertions', () => { }); }); }); +// tslint:enable:custom-no-magic-numbers diff --git a/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts b/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts index bf1000afa..304cd100b 100644 --- a/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts +++ b/packages/contract-wrappers/src/schemas/contract_wrappers_public_network_config_schema.ts @@ -1,9 +1,23 @@ +const networkNameToId: { [networkName: string]: number } = { + mainnet: 1, + ropsten: 3, + rinkeby: 4, + kovan: 42, + ganache: 50, +}; + export const contractWrappersPublicNetworkConfigSchema = { id: '/ZeroExContractPublicNetworkConfig', properties: { networkId: { type: 'number', - enum: [1, 3, 4, 42, 50], + enum: [ + networkNameToId.mainnet, + networkNameToId.kovan, + networkNameToId.ropsten, + networkNameToId.rinkeby, + networkNameToId.ganache, + ], }, gasPrice: { $ref: '/Number' }, zrxContractAddress: { $ref: '/Address' }, diff --git a/packages/contract-wrappers/src/utils/constants.ts b/packages/contract-wrappers/src/utils/constants.ts index 07da6745d..76d805cac 100644 --- a/packages/contract-wrappers/src/utils/constants.ts +++ b/packages/contract-wrappers/src/utils/constants.ts @@ -6,6 +6,7 @@ export const constants = { INVALID_JUMP_PATTERN: 'invalid JUMP at', OUT_OF_GAS_PATTERN: 'out of gas', INVALID_TAKER_FORMAT: 'instance.taker is not of a type(s) string', + // tslint:disable-next-line:custom-no-magic-numbers UNLIMITED_ALLOWANCE_IN_BASE_UNITS: new BigNumber(2).pow(256).minus(1), DEFAULT_BLOCK_POLLING_INTERVAL: 1000, }; diff --git a/packages/contract-wrappers/src/utils/filter_utils.ts b/packages/contract-wrappers/src/utils/filter_utils.ts index c5df7321e..4ec9e256b 100644 --- a/packages/contract-wrappers/src/utils/filter_utils.ts +++ b/packages/contract-wrappers/src/utils/filter_utils.ts @@ -73,14 +73,14 @@ export const filterUtils = { return false; } if (!_.isUndefined(filter.topics)) { - return filterUtils.matchesTopics(log.topics, filter.topics); + return filterUtils.doesMatchTopics(log.topics, filter.topics); } return true; }, - matchesTopics(logTopics: string[], filterTopics: Array): boolean { + doesMatchTopics(logTopics: string[], filterTopics: Array): boolean { const matchesTopic = _.zipWith(logTopics, filterTopics, filterUtils.matchesTopic.bind(filterUtils)); - const matchesTopics = _.every(matchesTopic); - return matchesTopics; + const doesMatchTopics = _.every(matchesTopic); + return doesMatchTopics; }, matchesTopic(logTopic: string, filterTopic: string[] | string | null): boolean { if (_.isArray(filterTopic)) { diff --git a/packages/contract-wrappers/src/utils/utils.ts b/packages/contract-wrappers/src/utils/utils.ts index af1125632..7cf9450a0 100644 --- a/packages/contract-wrappers/src/utils/utils.ts +++ b/packages/contract-wrappers/src/utils/utils.ts @@ -5,7 +5,8 @@ export const utils = { return new Error(`Unexpected switch value: ${value} encountered for ${name}`); }, getCurrentUnixTimestampSec(): BigNumber { - return new BigNumber(Date.now() / 1000).round(); + const milisecondsInSecond = 1000; + return new BigNumber(Date.now() / milisecondsInSecond).round(); }, getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts index e9a9705b1..74f84a485 100644 --- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts +++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts @@ -41,7 +41,7 @@ describe('EtherTokenWrapper', () => { let addressWithETH: string; let wethContractAddress: string; let depositWeiAmount: BigNumber; - let decimalPlaces: number; + const decimalPlaces = 7; let addressWithoutFunds: string; const gasPrice = new BigNumber(1); const zeroExConfig = { @@ -59,7 +59,6 @@ describe('EtherTokenWrapper', () => { addressWithETH = userAddresses[0]; wethContractAddress = contractWrappers.etherToken.getContractAddressIfExists() as string; depositWeiAmount = Web3Wrapper.toWei(new BigNumber(5)); - decimalPlaces = 7; addressWithoutFunds = userAddresses[1]; }); beforeEach(async () => { @@ -154,6 +153,7 @@ describe('EtherTokenWrapper', () => { const preWETHBalance = await contractWrappers.token.getBalanceAsync(wethContractAddress, addressWithETH); expect(preWETHBalance).to.be.bignumber.equal(0); + // tslint:disable-next-line:custom-no-magic-numbers const overWETHBalance = preWETHBalance.add(999999999); return expect( diff --git a/packages/contract-wrappers/test/global_hooks.ts b/packages/contract-wrappers/test/global_hooks.ts index 53b3ef545..fa1dfae38 100644 --- a/packages/contract-wrappers/test/global_hooks.ts +++ b/packages/contract-wrappers/test/global_hooks.ts @@ -8,7 +8,8 @@ import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise { // HACK: Since the migrations take longer then our global mocha timeout limit // we manually increase it for this before hook. - this.timeout(20000); + const mochaTestTimeoutMs = 20000; + this.timeout(mochaTestTimeoutMs); const txDefaults = { gas: devConstants.GAS_ESTIMATE, from: devConstants.TESTRPC_FIRST_ADDRESS, diff --git a/packages/contract-wrappers/test/order_validation_test.ts b/packages/contract-wrappers/test/order_validation_test.ts index d28549ba2..ed2159026 100644 --- a/packages/contract-wrappers/test/order_validation_test.ts +++ b/packages/contract-wrappers/test/order_validation_test.ts @@ -105,6 +105,7 @@ describe('OrderValidation', () => { }); it('should succeed if the order is asymmetric and fillable', async () => { const makerFillableAmount = fillableAmount; + // tslint:disable-next-line:custom-no-magic-numbers const takerFillableAmount = fillableAmount.minus(4); const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync( makerTokenAddress, @@ -171,6 +172,7 @@ describe('OrderValidation', () => { fillableAmount, ); // 27 <--> 28 + // tslint:disable-next-line:custom-no-magic-numbers signedOrder.ecSignature.v = 28 - signedOrder.ecSignature.v + 27; return expect( contractWrappers.exchange.validateFillOrderThrowIfInvalidAsync( @@ -205,7 +207,8 @@ describe('OrderValidation', () => { takerAddress, fillableAmount, ); - const nonTakerAddress = userAddresses[6]; + const sixthIndex = 6; + const nonTakerAddress = userAddresses[sixthIndex]; return expect( contractWrappers.exchange.validateFillOrderThrowIfInvalidAsync( signedOrder, @@ -352,7 +355,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - expect(transferFromAsync.callCount).to.be.equal(4); + const expectedCallCount = 4; + expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); expect( transferFromAsync .getCall(0) @@ -422,7 +426,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - expect(transferFromAsync.callCount).to.be.equal(4); + const expectedCallCount = 4; + expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); expect( transferFromAsync .getCall(0) @@ -490,7 +495,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - expect(transferFromAsync.callCount).to.be.equal(4); + const expectedCallCount = 4; + expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); const makerFillAmount = transferFromAsync.getCall(0).args[3]; expect(makerFillAmount).to.be.bignumber.equal(makerTokenAmount); }); @@ -517,7 +523,8 @@ describe('OrderValidation', () => { ); const makerPartialFee = makerFee.div(2); const takerPartialFee = takerFee.div(2); - expect(transferFromAsync.callCount).to.be.equal(4); + const expectedCallCount = 4; + expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); const partialMakerFee = transferFromAsync.getCall(2).args[3]; expect(partialMakerFee).to.be.bignumber.equal(makerPartialFee); const partialTakerFee = transferFromAsync.getCall(3).args[3]; diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts index 441c1bc28..3ee54ce4d 100644 --- a/packages/contracts/test/exchange/helpers.ts +++ b/packages/contracts/test/exchange/helpers.ts @@ -123,21 +123,21 @@ describe('Exchange', () => { }); it('should return true with a valid signature', async () => { - const success = await exchangeWrapper.isValidSignatureAsync(signedOrder); + const isValidSignatureForContract = await exchangeWrapper.isValidSignatureAsync(signedOrder); const orderHashHex = ZeroEx.getOrderHashHex(signedOrder); const isValidSignature = ZeroEx.isValidSignature(orderHashHex, signedOrder.ecSignature, signedOrder.maker); expect(isValidSignature).to.be.true(); - expect(success).to.be.true(); + expect(isValidSignatureForContract).to.be.true(); }); it('should return false with an invalid signature', async () => { signedOrder.ecSignature.r = ethUtil.bufferToHex(ethUtil.sha3('invalidR')); signedOrder.ecSignature.s = ethUtil.bufferToHex(ethUtil.sha3('invalidS')); - const success = await exchangeWrapper.isValidSignatureAsync(signedOrder); + const isValidSignatureForContract = await exchangeWrapper.isValidSignatureAsync(signedOrder); const orderHashHex = ZeroEx.getOrderHashHex(signedOrder); const isValidSignature = ZeroEx.isValidSignature(orderHashHex, signedOrder.ecSignature, signedOrder.maker); expect(isValidSignature).to.be.false(); - expect(success).to.be.false(); + expect(isValidSignatureForContract).to.be.false(); }); }); diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index da2e5fb5b..754efd256 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -99,8 +99,8 @@ describe('UnlimitedAllowanceToken', () => { const amountToTransfer = ownerBalance; const spenderAllowance = await zeroEx.token.getAllowanceAsync(tokenAddress, owner, spender); - const spenderAllowanceIsInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; - expect(spenderAllowanceIsInsufficient).to.be.true(); + const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; + expect(isSpenderAllowanceInsufficient).to.be.true(); return expect( token.transferFrom.callAsync(owner, spender, amountToTransfer, { diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts index 0056ed4b5..33132487f 100644 --- a/packages/contracts/test/zrx_token.ts +++ b/packages/contracts/test/zrx_token.ts @@ -117,8 +117,8 @@ describe('ZRXToken', () => { const amountToTransfer = ownerBalance; const spenderAllowance = await zeroEx.token.getAllowanceAsync(zrxAddress, owner, spender); - const spenderAllowanceIsInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; - expect(spenderAllowanceIsInsufficient).to.be.true(); + const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; + expect(isSpenderAllowanceInsufficient).to.be.true(); const didReturnTrue = await zrx.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender }); expect(didReturnTrue).to.be.false(); diff --git a/packages/contracts/tslint.json b/packages/contracts/tslint.json index ffaefe83a..1ab924e47 100644 --- a/packages/contracts/tslint.json +++ b/packages/contracts/tslint.json @@ -1,3 +1,6 @@ { - "extends": ["@0xproject/tslint-config"] + "extends": ["@0xproject/tslint-config"], + "rules": { + "custom-no-magic-numbers": false + } } diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 7b058781d..2e10fd71d 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -148,7 +148,8 @@ describe('Schema', () => { }); describe('#blockParamSchema', () => { it('should validate valid block param', () => { - const testCases = [42, 'latest', 'pending', 'earliest']; + const blockNumber = 42; + const testCases = [blockNumber, 'latest', 'pending', 'earliest']; validateAgainstSchema(testCases, blockParamSchema); }); it('should fail for invalid block param', () => { @@ -181,6 +182,7 @@ describe('Schema', () => { validateAgainstSchema(testCases, tokenSchema); }); it('should fail for invalid token', () => { + const num = 4; const testCases = [ { ...token, @@ -191,7 +193,7 @@ describe('Schema', () => { decimals: undefined, }, [], - 4, + num, ]; const shouldFail = true; validateAgainstSchema(testCases, tokenSchema, shouldFail); @@ -870,10 +872,12 @@ describe('Schema', () => { }); describe('#jsNumberSchema', () => { it('should validate valid js number', () => { + // tslint:disable-next-line:custom-no-magic-numbers const testCases = [1, 42]; validateAgainstSchema(testCases, jsNumber); }); it('should fail for invalid js number', () => { + // tslint:disable-next-line:custom-no-magic-numbers const testCases = [NaN, -1, new BigNumber(1)]; const shouldFail = true; validateAgainstSchema(testCases, jsNumber, shouldFail); @@ -881,13 +885,14 @@ describe('Schema', () => { }); describe('#txDataSchema', () => { it('should validate valid txData', () => { + const bigNumGasAmt = new BigNumber(42); const testCases = [ { from: NULL_ADDRESS, }, { from: NULL_ADDRESS, - gas: new BigNumber(42), + gas: bigNumGasAmt, }, { from: NULL_ADDRESS, diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index 96973fb62..2e42c6cc0 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -80,11 +80,12 @@ export const runMigrationsAsync = async (provider: Provider, artifactsDir: strin tokenInfo[0].swarmHash, { from: owner }, ); + const decimals = 18; await tokenReg.addToken.sendTransactionAsync( zrxToken.address, '0x Protocol Token', 'ZRX', - 18, + decimals, NULL_BYTES, NULL_BYTES, { @@ -96,7 +97,7 @@ export const runMigrationsAsync = async (provider: Provider, artifactsDir: strin etherToken.address, 'Ether Token', 'WETH', - 18, + decimals, NULL_BYTES, NULL_BYTES, { diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index 22614f01b..f5785343d 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -158,6 +158,7 @@ export const postpublishUtils = { // HACK: tsconfig.json needs wildcard directory endings as `/**/*` // but TypeDoc needs it as `/**` in order to pick up files at the root if (_.endsWith(includePath, '/**/*')) { + // tslint:disable-next-line:custom-no-magic-numbers includePath = includePath.slice(0, -2); } return includePath; diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 5c26475c9..73106821a 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -285,8 +285,8 @@ function shouldAddNewChangelogEntry(currentVersion: string, changelogs: Changelo return true; } const lastEntry = changelogs[0]; - const lastEntryCurrentVersion = lastEntry.version === currentVersion; - return lastEntryCurrentVersion; + const isLastEntryCurrentVersion = lastEntry.version === currentVersion; + return isLastEntryCurrentVersion; } function generateChangelogMd(changelogs: Changelog[]): string { diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index 1cde72a73..108344a04 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -17,7 +17,8 @@ const INVALID_TAKER_FORMAT = 'instance.taker is not of a type(s) string'; * We do not use BN anywhere else in the codebase. */ function bigNumberToBN(value: BigNumber): BN { - return new BN(value.toString(), 10); + const base = 10; + return new BN(value.toString(), base); } /** diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index b511573a8..28a8e7241 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -72,6 +72,7 @@ export async function signOrderHashAsync( // v + r + s OR r + s + v, and different clients (even different versions of the same client) // return the signature params in different orders. In order to support all client implementations, // we parse the signature in both ways, and evaluate if either one is a valid signature. + // tslint:disable-next-line:custom-no-magic-numbers const validVParamValues = [27, 28]; const ecSignatureVRS = parseSignatureHexAsVRS(signature); if (_.includes(validVParamValues, ecSignatureVRS.v)) { @@ -95,11 +96,19 @@ export async function signOrderHashAsync( function parseSignatureHexAsVRS(signatureHex: string): ECSignature { const signatureBuffer = ethUtil.toBuffer(signatureHex); let v = signatureBuffer[0]; - if (v < 27) { - v += 27; + // HACK: Sometimes v is returned as [0, 1] and sometimes as [27, 28] + // If it is returned as [0, 1], add 27 to both so it becomes [27, 28] + const lowestValidV = 27; + const isProperlyFormattedV = v < lowestValidV; + if (!isProperlyFormattedV) { + v += lowestValidV; } - const r = signatureBuffer.slice(1, 33); - const s = signatureBuffer.slice(33, 65); + // signatureBuffer contains vrs + const vEndIndex = 1; + const rsIndex = 33; + const r = signatureBuffer.slice(vEndIndex, rsIndex); + const sEndIndex = 65; + const s = signatureBuffer.slice(rsIndex, sEndIndex); const ecSignature: ECSignature = { v, r: ethUtil.bufferToHex(r), diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 553ec2e53..4a78592aa 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -46,12 +46,13 @@ describe('Signature utils', () => { }); describe('#generateSalt', () => { it('generates different salts', () => { - const equal = generatePseudoRandomSalt().eq(generatePseudoRandomSalt()); - expect(equal).to.be.false(); + const isEqual = generatePseudoRandomSalt().eq(generatePseudoRandomSalt()); + expect(isEqual).to.be.false(); }); it('generates salt in range [0..2^256)', () => { const salt = generatePseudoRandomSalt(); expect(salt.greaterThanOrEqualTo(0)).to.be.true(); + // tslint:disable-next-line:custom-no-magic-numbers const twoPow256 = new BigNumber(2).pow(256); expect(salt.lessThan(twoPow256)).to.be.true(); }); @@ -66,7 +67,8 @@ describe('Signature utils', () => { expect(isValid).to.be.false(); }); it('returns true if order hash is correct', () => { - const isValid = isValidOrderHash('0x' + Array(65).join('0')); + const orderHashLength = 65; + const isValid = isValidOrderHash('0x' + Array(orderHashLength).join('0')); expect(isValid).to.be.true(); }); }); @@ -110,10 +112,12 @@ describe('Signature utils', () => { if (payload.method === 'eth_sign') { const [address, message] = payload.params; const signature = await web3Wrapper.signMessageAsync(address, message); + // tslint:disable-next-line:custom-no-magic-numbers + const rsvHex = `0x${signature.substr(130)}${signature.substr(2, 128)}`; callback(null, { id: 42, jsonrpc: '2.0', - result: `0x${signature.substr(130)}${signature.substr(2, 128)}`, + result: rsvHex, }); } else { callback(null, { id: 42, jsonrpc: '2.0', result: [makerAddress] }); diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 3c93d6293..29936a066 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -60,6 +60,7 @@ interface OrderStateByOrderHash { [orderHash: string]: OrderState; } +// tslint:disable-next-line:custom-no-magic-numbers const DEFAULT_CLEANUP_JOB_INTERVAL_MS = 1000 * 60 * 60; // 1h /** @@ -130,7 +131,8 @@ export class OrderWatcher { assert.isValidSignature(orderHash, signedOrder.ecSignature, signedOrder.maker); this._orderByOrderHash[orderHash] = signedOrder; this._addToDependentOrderHashes(signedOrder, orderHash); - const expirationUnixTimestampMs = signedOrder.expirationUnixTimestampSec.times(1000); + const milisecondsInASecond = 1000; + const expirationUnixTimestampMs = signedOrder.expirationUnixTimestampSec.times(milisecondsInASecond); this._expirationWatcher.addOrder(orderHash, expirationUnixTimestampMs); } /** diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts index af1125632..d34f6b99f 100644 --- a/packages/order-watcher/src/utils/utils.ts +++ b/packages/order-watcher/src/utils/utils.ts @@ -5,7 +5,8 @@ export const utils = { return new Error(`Unexpected switch value: ${value} encountered for ${name}`); }, getCurrentUnixTimestampSec(): BigNumber { - return new BigNumber(Date.now() / 1000).round(); + const milisecondsInASecond = 1000; + return new BigNumber(Date.now() / milisecondsInASecond).round(); }, getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); diff --git a/packages/order-watcher/test/expiration_watcher_test.ts b/packages/order-watcher/test/expiration_watcher_test.ts index 0a2524d78..5672748a1 100644 --- a/packages/order-watcher/test/expiration_watcher_test.ts +++ b/packages/order-watcher/test/expiration_watcher_test.ts @@ -21,6 +21,7 @@ import { provider, web3Wrapper } from './utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); +const MILISECONDS_IN_SECOND = 1000; describe('ExpirationWatcher', () => { let contractWrappers: ContractWrappers; @@ -83,13 +84,13 @@ describe('ExpirationWatcher', () => { expirationUnixTimestampSec, ); const orderHash = getOrderHashHex(signedOrder); - expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(1000)); + expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND)); const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)((hash: string) => { expect(hash).to.be.equal(orderHash); expect(utils.getCurrentUnixTimestampSec()).to.be.bignumber.gte(expirationUnixTimestampSec); }); expirationWatcher.subscribe(callbackAsync); - timer.tick(orderLifetimeSec * 1000); + timer.tick(orderLifetimeSec * MILISECONDS_IN_SECOND); })().catch(done); }); it("doesn't emit events before order expires", (done: DoneCallback) => { @@ -105,13 +106,13 @@ describe('ExpirationWatcher', () => { expirationUnixTimestampSec, ); const orderHash = getOrderHashHex(signedOrder); - expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(1000)); + expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND)); const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (hash: string) => { done(new Error('Emitted expiration went before the order actually expired')); }); expirationWatcher.subscribe(callbackAsync); const notEnoughTime = orderLifetimeSec - 1; - timer.tick(notEnoughTime * 1000); + timer.tick(notEnoughTime * MILISECONDS_IN_SECOND); done(); })().catch(done); }); @@ -139,8 +140,14 @@ describe('ExpirationWatcher', () => { ); const orderHash1 = getOrderHashHex(signedOrder1); const orderHash2 = getOrderHashHex(signedOrder2); - expirationWatcher.addOrder(orderHash2, signedOrder2.expirationUnixTimestampSec.times(1000)); - expirationWatcher.addOrder(orderHash1, signedOrder1.expirationUnixTimestampSec.times(1000)); + expirationWatcher.addOrder( + orderHash2, + signedOrder2.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND), + ); + expirationWatcher.addOrder( + orderHash1, + signedOrder1.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND), + ); const expirationOrder = [orderHash1, orderHash2]; const expectToBeCalledOnce = false; const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done, expectToBeCalledOnce)( @@ -153,7 +160,7 @@ describe('ExpirationWatcher', () => { }, ); expirationWatcher.subscribe(callbackAsync); - timer.tick(order2Lifetime * 1000); + timer.tick(order2Lifetime * MILISECONDS_IN_SECOND); })().catch(done); }); it('emits events in correct order when expirations are equal', (done: DoneCallback) => { @@ -180,8 +187,14 @@ describe('ExpirationWatcher', () => { ); const orderHash1 = getOrderHashHex(signedOrder1); const orderHash2 = getOrderHashHex(signedOrder2); - expirationWatcher.addOrder(orderHash1, signedOrder1.expirationUnixTimestampSec.times(1000)); - expirationWatcher.addOrder(orderHash2, signedOrder2.expirationUnixTimestampSec.times(1000)); + expirationWatcher.addOrder( + orderHash1, + signedOrder1.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND), + ); + expirationWatcher.addOrder( + orderHash2, + signedOrder2.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND), + ); const expirationOrder = orderHash1 < orderHash2 ? [orderHash1, orderHash2] : [orderHash2, orderHash1]; const expectToBeCalledOnce = false; const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done, expectToBeCalledOnce)( @@ -194,7 +207,7 @@ describe('ExpirationWatcher', () => { }, ); expirationWatcher.subscribe(callbackAsync); - timer.tick(order2Lifetime * 1000); + timer.tick(order2Lifetime * MILISECONDS_IN_SECOND); })().catch(done); }); }); diff --git a/packages/order-watcher/test/global_hooks.ts b/packages/order-watcher/test/global_hooks.ts index 53b3ef545..fa1dfae38 100644 --- a/packages/order-watcher/test/global_hooks.ts +++ b/packages/order-watcher/test/global_hooks.ts @@ -8,7 +8,8 @@ import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise { // HACK: Since the migrations take longer then our global mocha timeout limit // we manually increase it for this before hook. - this.timeout(20000); + const mochaTestTimeoutMs = 20000; + this.timeout(mochaTestTimeoutMs); const txDefaults = { gas: devConstants.GAS_ESTIMATE, from: devConstants.TESTRPC_FIRST_ADDRESS, diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index 8c9249f58..991518269 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -268,8 +268,8 @@ describe('OrderWatcher', () => { }); it('should trigger the callback when orders backing ZRX allowance changes', (done: DoneCallback) => { (async () => { - const makerFee = Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18); - const takerFee = Web3Wrapper.toBaseUnitAmount(new BigNumber(0), 18); + const makerFee = Web3Wrapper.toBaseUnitAmount(new BigNumber(2), decimals); + const takerFee = Web3Wrapper.toBaseUnitAmount(new BigNumber(0), decimals); signedOrder = await fillScenarios.createFillableSignedOrderWithFeesAsync( makerToken.address, takerToken.address, diff --git a/packages/react-docs/src/docs_info.ts b/packages/react-docs/src/docs_info.ts index e9c84b7c9..6f4f39f00 100644 --- a/packages/react-docs/src/docs_info.ts +++ b/packages/react-docs/src/docs_info.ts @@ -64,8 +64,8 @@ export class DocsInfo { finalMenu.contracts = _.filter(finalMenu.contracts, (contractName: string) => { const versionIntroducedIfExists = this._docsInfo.menuSubsectionToVersionWhenIntroduced[contractName]; if (!_.isUndefined(versionIntroducedIfExists)) { - const existsInSelectedVersion = compareVersions(selectedVersion, versionIntroducedIfExists) >= 0; - return existsInSelectedVersion; + const doesExistInSelectedVersion = compareVersions(selectedVersion, versionIntroducedIfExists) >= 0; + return doesExistInSelectedVersion; } else { return true; } diff --git a/packages/react-docs/tslint.json b/packages/react-docs/tslint.json index ee918e360..c78434416 100644 --- a/packages/react-docs/tslint.json +++ b/packages/react-docs/tslint.json @@ -3,6 +3,7 @@ "rules": { "no-object-literal-type-assertion": false, "completed-docs": false, - "prefer-function-over-method": false + "prefer-function-over-method": false, + "custom-no-magic-numbers": false } } diff --git a/packages/react-shared/tslint.json b/packages/react-shared/tslint.json index ee918e360..c78434416 100644 --- a/packages/react-shared/tslint.json +++ b/packages/react-shared/tslint.json @@ -3,6 +3,7 @@ "rules": { "no-object-literal-type-assertion": false, "completed-docs": false, - "prefer-function-over-method": false + "prefer-function-over-method": false, + "custom-no-magic-numbers": false } } diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index efb30091b..c17616246 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -152,7 +152,8 @@ export class Compiler { logUtils.log(`Downloading ${fullSolcVersion}...`); const url = `${constants.BASE_COMPILER_URL}${fullSolcVersion}`; const response = await fetch(url); - if (response.status !== 200) { + const SUCCESS_STATUS = 200; + if (response.status !== SUCCESS_STATUS) { throw new Error(`Failed to load ${fullSolcVersion}`); } solcjs = await response.text(); diff --git a/packages/sol-compiler/test/compiler_test.ts b/packages/sol-compiler/test/compiler_test.ts index d0f121897..c7747741f 100644 --- a/packages/sol-compiler/test/compiler_test.ts +++ b/packages/sol-compiler/test/compiler_test.ts @@ -38,8 +38,12 @@ describe('#Compiler', function(): void { const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); // The last 43 bytes of the binaries are metadata which may not be equivalent - const unlinkedBinaryWithoutMetadata = exchangeArtifact.compilerOutput.evm.bytecode.object.slice(2, -86); - const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -86); + const last43BytesIndex = -86; + const unlinkedBinaryWithoutMetadata = exchangeArtifact.compilerOutput.evm.bytecode.object.slice( + 2, + last43BytesIndex, + ); + const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, last43BytesIndex); expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata); }); }); diff --git a/packages/sol-cov/test/collect_coverage_entries_test.ts b/packages/sol-cov/test/collect_coverage_entries_test.ts index c7b9d44b1..f60a57cb7 100644 --- a/packages/sol-cov/test/collect_coverage_entries_test.ts +++ b/packages/sol-cov/test/collect_coverage_entries_test.ts @@ -39,13 +39,15 @@ describe('Collect coverage entries', () => { const coverageEntries = collectCoverageEntries(simpleStorageContract); const fnIds = _.keys(coverageEntries.fnMap); expect(coverageEntries.fnMap[fnIds[0]].name).to.be.equal('set'); - expect(coverageEntries.fnMap[fnIds[0]].line).to.be.equal(5); + const setExpectedLineNumber = 5; + expect(coverageEntries.fnMap[fnIds[0]].line).to.be.equal(setExpectedLineNumber); const setFunction = `function set(uint x) { storedData = x; }`; expect(getRange(simpleStorageContract, coverageEntries.fnMap[fnIds[0]].loc)).to.be.equal(setFunction); expect(coverageEntries.fnMap[fnIds[1]].name).to.be.equal('get'); - expect(coverageEntries.fnMap[fnIds[1]].line).to.be.equal(8); + const getExpectedLineNumber = 8; + expect(coverageEntries.fnMap[fnIds[1]].line).to.be.equal(getExpectedLineNumber); const getFunction = `function get() constant returns (uint retVal) { return storedData; }`; @@ -121,6 +123,7 @@ describe('Collect coverage entries', () => { const branchDescriptions = _.values(coverageEntries.branchMap); const branchLines = _.map(branchDescriptions, branchDescription => branchDescription.line); + // tslint:disable-next-line:custom-no-magic-numbers expect(branchLines).to.be.deep.equal([94, 115, 119, 130, 151, 187]); const branchTypes = _.map(branchDescriptions, branchDescription => branchDescription.type); expect(branchTypes).to.be.deep.equal(['if', 'if', 'if', 'if', 'binary-expr', 'if']); diff --git a/packages/sol-cov/test/instructions_test.ts b/packages/sol-cov/test/instructions_test.ts index 195dfce2f..bb8fb5bf6 100644 --- a/packages/sol-cov/test/instructions_test.ts +++ b/packages/sol-cov/test/instructions_test.ts @@ -11,6 +11,7 @@ const expect = chai.expect; describe('instructions', () => { describe('#getPcToInstructionIndexMapping', () => { it('correctly maps pcs to instruction indexed', () => { + // tslint:disable-next-line:custom-no-magic-numbers const bytecode = new Uint8Array([constants.PUSH1, 42, constants.PUSH2, 1, 2, constants.TIMESTAMP]); const pcToInstruction = getPcToInstructionIndexMapping(bytecode); const expectedPcToInstruction = { '0': 0, '2': 1, '5': 2 }; diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts index 9a203b654..3b72ad44e 100644 --- a/packages/sra-report/src/index.ts +++ b/packages/sra-report/src/index.ts @@ -13,7 +13,18 @@ import { postmanEnvironmentFactory } from './postman_environment_factory'; import { utils } from './utils'; const DEFAULT_NETWORK_ID = 1; -const SUPPORTED_NETWORK_IDS = [1, 3, 4, 42]; +const networkNameToId: { [networkName: string]: number } = { + mainnet: 1, + ropsten: 3, + rinkeby: 4, + kovan: 42, +}; +const SUPPORTED_NETWORK_IDS = [ + networkNameToId.mainnet, + networkNameToId.ropsten, + networkNameToId.rinkeby, + networkNameToId.kovan, +]; // extract command line arguments const args = yargs diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index 42389aea2..e899aaa79 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -11,6 +11,12 @@ import { addresses as rinkebyAddresses } from './contract_addresses/rinkeby_addr import { addresses as ropstenAddresses } from './contract_addresses/ropsten_addresses'; const ENVIRONMENT_NAME = 'SRA Report'; +const networkNameToId: { [networkName: string]: number } = { + mainnet: 1, + ropsten: 3, + rinkeby: 4, + kovan: 42, +}; export interface EnvironmentValue { key: string; @@ -107,13 +113,13 @@ async function createOrderEnvironmentValuesAsync(url: string): Promise { it('fails when there are no headers', async () => { - nockInterceptor.reply(200, {}); + nockInterceptor.reply(SUCCESS_STATUS, {}); const summary = await utils.newmanRunAsync(newmanRunOptions); const error = findAssertionErrorIfExists( summary, @@ -60,7 +61,7 @@ export const testRunner = { const headers = { 'Content-Type': 'text/html', }; - nockInterceptor.reply(200, {}, headers); + nockInterceptor.reply(SUCCESS_STATUS, {}, headers); const summary = await utils.newmanRunAsync(newmanRunOptions); const error = findAssertionErrorIfExists( summary, @@ -75,7 +76,7 @@ export const testRunner = { const headers = { 'Content-Type': 'charset=utf-8; application/json', }; - nockInterceptor.reply(200, {}, headers); + nockInterceptor.reply(SUCCESS_STATUS, {}, headers); const summary = await utils.newmanRunAsync(newmanRunOptions); const error = findAssertionErrorIfExists( summary, @@ -99,7 +100,7 @@ export const testRunner = { }; describe(SCHEMA_ASSERTION_NAME, () => { it('fails when schema is invalid', async () => { - nockInterceptor.reply(200, malformedJson); + nockInterceptor.reply(SUCCESS_STATUS, malformedJson); const summary = await utils.newmanRunAsync(newmanRunOptions); const error = findAssertionErrorIfExists(summary, postmanCollectionRequestName, SCHEMA_ASSERTION_NAME); const errorMessage = _.get(error, 'message'); @@ -107,7 +108,7 @@ export const testRunner = { expect(errorMessage).to.equal('expected false to be true'); }); it('passes when schema is valid', async () => { - nockInterceptor.reply(200, correctJson); + nockInterceptor.reply(SUCCESS_STATUS, correctJson); const summary = await utils.newmanRunAsync(newmanRunOptions); const error = findAssertionErrorIfExists(summary, postmanCollectionRequestName, SCHEMA_ASSERTION_NAME); const errorMessage = _.get(error, 'message'); diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 347eda55f..467299db0 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -113,9 +113,12 @@ export class LedgerSubprovider extends BaseWalletSubprovider { const tx = new EthereumTx(txParams); // Set the EIP155 bits - tx.raw[6] = Buffer.from([this._networkId]); // v - tx.raw[7] = Buffer.from([]); // r - tx.raw[8] = Buffer.from([]); // s + const vIndex = 6; + tx.raw[vIndex] = Buffer.from([this._networkId]); // v + const rIndex = 7; + tx.raw[rIndex] = Buffer.from([]); // r + const sIndex = 8; + tx.raw[sIndex] = Buffer.from([]); // s const txHex = tx.serialize().toString('hex'); try { @@ -127,7 +130,8 @@ export class LedgerSubprovider extends BaseWalletSubprovider { tx.v = Buffer.from(result.v, 'hex'); // EIP155: v should be chain_id * 2 + {35, 36} - const signedChainId = Math.floor((tx.v[0] - 35) / 2); + const eip55Constant = 35; + const signedChainId = Math.floor((tx.v[0] - eip55Constant) / 2); if (signedChainId !== this._networkId) { await this._destroyLedgerClientAsync(); const err = new Error(LedgerSubproviderErrors.TooOldLedgerFirmware); @@ -169,8 +173,10 @@ export class LedgerSubprovider extends BaseWalletSubprovider { fullDerivationPath, ethUtil.stripHexPrefix(data), ); - const v = result.v - 27; - let vHex = v.toString(16); + const lowestValidV = 27; + const v = result.v - lowestValidV; + const hexBase = 16; + let vHex = v.toString(hexBase); if (vHex.length < 2) { vHex = `0${v}`; } diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts index 907330111..345e5e975 100644 --- a/packages/subproviders/src/subproviders/nonce_tracker.ts +++ b/packages/subproviders/src/subproviders/nonce_tracker.ts @@ -93,7 +93,8 @@ export class NonceTrackerSubprovider extends Subprovider { // Increment the nonce from the previous successfully submitted transaction let nonce = ethUtil.bufferToInt(transaction.nonce); nonce++; - let nextHexNonce = nonce.toString(16); + const hexBase = 16; + let nextHexNonce = nonce.toString(hexBase); if (nextHexNonce.length % 2) { nextHexNonce = `0${nextHexNonce}`; } diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts index 56d2381a0..cb6dffc4a 100644 --- a/packages/subproviders/src/subproviders/subprovider.ts +++ b/packages/subproviders/src/subproviders/subprovider.ts @@ -13,10 +13,11 @@ export abstract class Subprovider { // Ported from: https://github.com/MetaMask/provider-engine/blob/master/util/random-id.js private static _getRandomId(): number { const extraDigits = 3; + const baseTen = 10; // 13 time digits - const datePart = new Date().getTime() * Math.pow(10, extraDigits); + const datePart = new Date().getTime() * Math.pow(baseTen, extraDigits); // 3 random digits - const extraPart = Math.floor(Math.random() * Math.pow(10, extraDigits)); + const extraPart = Math.floor(Math.random() * Math.pow(baseTen, extraDigits)); // 16 digits return datePart + extraPart; } diff --git a/packages/subproviders/src/utils/wallet_utils.ts b/packages/subproviders/src/utils/wallet_utils.ts index cd5cd9ba0..c36fdb9fc 100644 --- a/packages/subproviders/src/utils/wallet_utils.ts +++ b/packages/subproviders/src/utils/wallet_utils.ts @@ -30,10 +30,10 @@ class DerivedHDKeyInfoIterator implements IterableIterator { baseDerivationPath, derivationPath: fullDerivationPath, }; - const done = this._index === this._searchLimit; + const isDone = this._index === this._searchLimit; this._index++; return { - done, + done: isDone, value: derivedKey, }; } diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts index f1c634a77..8bf571041 100644 --- a/packages/subproviders/test/integration/ledger_subprovider_test.ts +++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts @@ -19,6 +19,8 @@ import { reportCallbackErrors } from '../utils/report_callback_errors'; chaiSetup.configure(); const expect = chai.expect; +const DEFAULT_NUM_ACCOUNTS = 10; +const EXPECTED_SIGNATURE_LENGTH = 132; async function ledgerEthereumNodeJsClientFactoryAsync(): Promise { const ledgerConnection = await TransportNodeHid.create(); @@ -40,7 +42,7 @@ describe('LedgerSubprovider', () => { it('returns default number of accounts', async () => { const accounts = await ledgerSubprovider.getAccountsAsync(); expect(accounts[0]).to.not.be.an('undefined'); - expect(accounts.length).to.be.equal(10); + expect(accounts.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); }); it('returns the expected accounts from a ledger set up with the test mnemonic', async () => { const accounts = await ledgerSubprovider.getAccountsAsync(); @@ -104,7 +106,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(10); + expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); done(); }); ledgerProvider.sendAsync(payload, callback); @@ -122,7 +124,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(132); + expect(response.result.length).to.be.equal(EXPECTED_SIGNATURE_LENGTH); expect(response.result.substr(0, 2)).to.be.equal('0x'); done(); }); @@ -142,7 +144,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(132); + expect(response.result.length).to.be.equal(EXPECTED_SIGNATURE_LENGTH); expect(response.result.substr(0, 2)).to.be.equal('0x'); done(); }); @@ -196,7 +198,8 @@ describe('LedgerSubprovider', () => { const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); const result = response.result; - expect(result.length).to.be.equal(66); + const signedTxLength = 66; + expect(result.length).to.be.equal(signedTxLength); expect(result.substr(0, 2)).to.be.equal('0x'); done(); }); diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts index 892c2acd0..d5a125697 100644 --- a/packages/subproviders/test/unit/ledger_subprovider_test.ts +++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts @@ -20,6 +20,7 @@ import { reportCallbackErrors } from '../utils/report_callback_errors'; chaiSetup.configure(); const expect = chai.expect; const FAKE_ADDRESS = '0xb088a3bc93f71b4de97b9de773e9647645983688'; +const DEFAULT_NUM_ACCOUNTS = 10; describe('LedgerSubprovider', () => { const networkId: number = 42; @@ -72,7 +73,7 @@ describe('LedgerSubprovider', () => { it('returns default number of accounts', async () => { const accounts = await ledgerSubprovider.getAccountsAsync(); expect(accounts[0]).to.be.equal(FAKE_ADDRESS); - expect(accounts.length).to.be.equal(10); + expect(accounts.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); }); it('returns requested number of accounts', async () => { const numberOfAccounts = 20; @@ -118,7 +119,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(10); + expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); expect(response.result[0]).to.be.equal(FAKE_ADDRESS); done(); }); @@ -175,7 +176,8 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.raw.length).to.be.equal(192); + const rawTxLength = 192; + expect(response.result.raw.length).to.be.equal(rawTxLength); expect(response.result.raw.substr(0, 2)).to.be.equal('0x'); done(); }); diff --git a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts index 93300f47d..b27147e12 100644 --- a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts +++ b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts @@ -17,6 +17,7 @@ import { reportCallbackErrors } from '../utils/report_callback_errors'; chaiSetup.configure(); const expect = chai.expect; +const DEFAULT_NUM_ACCOUNTS = 10; describe('MnemonicWalletSubprovider', () => { let subprovider: MnemonicWalletSubprovider; @@ -32,7 +33,7 @@ describe('MnemonicWalletSubprovider', () => { const accounts = await subprovider.getAccountsAsync(); expect(accounts[0]).to.be.equal(fixtureData.TEST_RPC_ACCOUNT_0); expect(accounts[1]).to.be.equal(fixtureData.TEST_RPC_ACCOUNT_1); - expect(accounts.length).to.be.equal(10); + expect(accounts.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); }); it('signs a personal message', async () => { const data = ethUtils.bufferToHex(ethUtils.toBuffer(fixtureData.PERSONAL_MESSAGE_STRING)); @@ -89,7 +90,7 @@ describe('MnemonicWalletSubprovider', () => { const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result[0]).to.be.equal(fixtureData.TEST_RPC_ACCOUNT_0); - expect(response.result.length).to.be.equal(10); + expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); done(); }); provider.sendAsync(payload, callback); diff --git a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts index 9115186f4..7397d26f7 100644 --- a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts +++ b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts @@ -13,6 +13,7 @@ import { reportCallbackErrors } from '../utils/report_callback_errors'; const expect = chai.expect; chaiSetup.configure(); +const DEFAULT_NUM_ACCOUNTS = 10; describe('RedundantSubprovider', () => { let provider: Web3ProviderEngine; @@ -31,7 +32,7 @@ describe('RedundantSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(10); + expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); done(); }); provider.sendAsync(payload, callback); @@ -54,7 +55,7 @@ describe('RedundantSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(10); + expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); done(); }); provider.sendAsync(payload, callback); diff --git a/packages/testnet-faucets/src/ts/constants.ts b/packages/testnet-faucets/src/ts/constants.ts new file mode 100644 index 000000000..c6370e3f6 --- /dev/null +++ b/packages/testnet-faucets/src/ts/constants.ts @@ -0,0 +1,5 @@ +export const constants = { + SUCCESS_STATUS: 200, + SERVICE_UNAVAILABLE_STATUS: 503, + BAD_REQUEST_STATUS: 400, +}; diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 3858b5339..d5f0dc2f9 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -15,6 +15,7 @@ import ProviderEngine = require('web3-provider-engine'); import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); import { configs } from './configs'; +import { constants } from './constants'; import { DispatchQueue } from './dispatch_queue'; import { dispenseAssetTasks } from './dispense_asset_tasks'; import { rpcUrls } from './rpc_urls'; @@ -80,7 +81,7 @@ export class Handler { }; }); const payload = JSON.stringify(queueInfo); - res.status(200).send(payload); + res.status(constants.SUCCESS_STATUS).send(payload); } public dispenseEther(req: express.Request, res: express.Response): void { this._dispenseAsset(req, res, RequestedAssetType.ETH); @@ -120,11 +121,11 @@ export class Handler { } const didAddToQueue = networkConfig.dispatchQueue.add(dispenserTask); if (!didAddToQueue) { - res.status(503).send('QUEUE_IS_FULL'); + res.status(constants.SERVICE_UNAVAILABLE_STATUS).send('QUEUE_IS_FULL'); return; } logUtils.log(`Added ${recipient} to queue: ${requestedAssetType} networkId: ${networkId}`); - res.status(200).end(); + res.status(constants.SUCCESS_STATUS).end(); } private async _dispenseOrderAsync( req: express.Request, @@ -133,7 +134,7 @@ export class Handler { ): Promise { const networkConfig = _.get(this._networkConfigByNetworkId, req.params.networkId); if (_.isUndefined(networkConfig)) { - res.status(400).send('UNSUPPORTED_NETWORK_ID'); + res.status(constants.BAD_REQUEST_STATUS).send('UNSUPPORTED_NETWORK_ID'); return; } const zeroEx = networkConfig.zeroEx; @@ -173,6 +174,6 @@ export class Handler { const signedOrderHash = ZeroEx.getOrderHashHex(signedOrder); const payload = JSON.stringify(signedOrder); logUtils.log(`Dispensed signed order: ${payload}`); - res.status(200).send(payload); + res.status(constants.SUCCESS_STATUS).send(payload); } } diff --git a/packages/testnet-faucets/src/ts/parameter_transformer.ts b/packages/testnet-faucets/src/ts/parameter_transformer.ts index 58bf154dc..b9929a0d9 100644 --- a/packages/testnet-faucets/src/ts/parameter_transformer.ts +++ b/packages/testnet-faucets/src/ts/parameter_transformer.ts @@ -3,6 +3,7 @@ import { NextFunction, Request, Response } from 'express'; import * as _ from 'lodash'; import { configs } from './configs'; +import { constants } from './constants'; import { rpcUrls } from './rpc_urls'; const DEFAULT_NETWORK_ID = 42; // kovan @@ -11,7 +12,7 @@ export const parameterTransformer = { transform(req: Request, res: Response, next: NextFunction): void { const recipientAddress = req.params.recipient; if (_.isUndefined(recipientAddress) || !addressUtils.isAddress(recipientAddress)) { - res.status(400).send('INVALID_RECIPIENT_ADDRESS'); + res.status(constants.BAD_REQUEST_STATUS).send('INVALID_RECIPIENT_ADDRESS'); return; } const lowerCaseRecipientAddress = recipientAddress.toLowerCase(); @@ -19,7 +20,7 @@ export const parameterTransformer = { const networkId = _.get(req.query, 'networkId', DEFAULT_NETWORK_ID); const rpcUrlIfExists = _.get(rpcUrls, networkId); if (_.isUndefined(rpcUrlIfExists)) { - res.status(400).send('UNSUPPORTED_NETWORK_ID'); + res.status(constants.BAD_REQUEST_STATUS).send('UNSUPPORTED_NETWORK_ID'); return; } req.params.networkId = networkId; diff --git a/packages/testnet-faucets/src/ts/server.ts b/packages/testnet-faucets/src/ts/server.ts index 198a5fdc9..55c1d55d8 100644 --- a/packages/testnet-faucets/src/ts/server.ts +++ b/packages/testnet-faucets/src/ts/server.ts @@ -1,6 +1,7 @@ import * as bodyParser from 'body-parser'; import * as express from 'express'; +import { constants } from './constants'; import { errorReporter } from './error_reporter'; import { Handler } from './handler'; import { parameterTransformer } from './parameter_transformer'; @@ -18,7 +19,7 @@ app.use((req, res, next) => { const handler = new Handler(); app.get('/ping', (req: express.Request, res: express.Response) => { - res.status(200).send('pong'); + res.status(constants.SUCCESS_STATUS).send('pong'); }); app.get('/info', handler.getQueueInfo.bind(handler)); app.get('/ether/:recipient', parameterTransformer.transform, handler.dispenseEther.bind(handler)); @@ -28,5 +29,6 @@ app.get('/order/zrx/:recipient', parameterTransformer.transform, handler.dispens // Log to rollbar any errors unhandled by handlers app.use(errorReporter.errorHandler()); -const port = process.env.PORT || 3000; +const DEFAULT_PORT = 3000; +const port = process.env.PORT || DEFAULT_PORT; app.listen(port); diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index d329f917a..654c7753b 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -23,7 +23,8 @@ export class AbiDecoder { formatted = formatted.slice(2); } - formatted = _.padStart(formatted, 40, '0'); + const desiredLength = 40; + formatted = _.padStart(formatted, desiredLength, '0'); return `0x${formatted}`; } constructor(abiArrays: AbiDefinition[][]) { @@ -45,16 +46,17 @@ export class AbiDecoder { const dataTypes = _.map(nonIndexedInputs, input => input.type); const decodedData = ethersInterface.events[event.name].parse(log.data); - let failedToDecode = false; + let didFailToDecode = false; _.forEach(event.inputs, (param: EventParameter, i: number) => { // Indexed parameters are stored in topics. Non-indexed ones in decodedData let value: BigNumber | string | number = param.indexed ? log.topics[topicsIndex++] : decodedData[i]; if (_.isUndefined(value)) { - failedToDecode = true; + didFailToDecode = true; return; } if (param.type === SolidityTypes.Address) { - value = AbiDecoder._padZeros(new BigNumber(value).toString(16)); + const baseHex = 16; + value = AbiDecoder._padZeros(new BigNumber(value).toString(baseHex)); } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) { value = new BigNumber(value); } else if (param.type === SolidityTypes.Uint8) { @@ -63,7 +65,7 @@ export class AbiDecoder { decodedParams[param.name] = value; }); - if (failedToDecode) { + if (didFailToDecode) { return log; } else { return { diff --git a/packages/utils/src/address_utils.ts b/packages/utils/src/address_utils.ts index f94985441..e25bde249 100644 --- a/packages/utils/src/address_utils.ts +++ b/packages/utils/src/address_utils.ts @@ -9,11 +9,16 @@ export const addressUtils = { const unprefixedAddress = address.replace('0x', ''); const addressHash = jsSHA3.keccak256(unprefixedAddress.toLowerCase()); - for (let i = 0; i < 40; i++) { + const addressLength = 40; + for (let i = 0; i < addressLength; i++) { // The nth letter should be uppercase if the nth digit of casemap is 1 + const hexBase = 16; + const lowercaseRange = 7; if ( - (parseInt(addressHash[i], 16) > 7 && unprefixedAddress[i].toUpperCase() !== unprefixedAddress[i]) || - (parseInt(addressHash[i], 16) <= 7 && unprefixedAddress[i].toLowerCase() !== unprefixedAddress[i]) + (parseInt(addressHash[i], hexBase) > lowercaseRange && + unprefixedAddress[i].toUpperCase() !== unprefixedAddress[i]) || + (parseInt(addressHash[i], hexBase) <= lowercaseRange && + unprefixedAddress[i].toLowerCase() !== unprefixedAddress[i]) ) { return false; } diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts index 6984bf42d..6784d5b35 100644 --- a/packages/utils/src/interval_utils.ts +++ b/packages/utils/src/interval_utils.ts @@ -6,18 +6,18 @@ export const intervalUtils = { intervalMs: number, onError: (err: Error) => void, ): NodeJS.Timer { - let locked = false; + let isLocked = false; const intervalId = setInterval(async () => { - if (locked) { + if (isLocked) { return; } else { - locked = true; + isLocked = true; try { await fn(); } catch (err) { onError(err); } - locked = false; + isLocked = false; } }, intervalMs); return intervalId; diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index c60d5fe33..91a1af870 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -19,6 +19,8 @@ import * as Web3 from 'web3'; import { Web3WrapperErrors } from './types'; +const BASE_TEN = 10; + /** * A wrapper around the Web3.js 0.x library that provides a consistent, clean promise-based interface. */ @@ -48,7 +50,7 @@ export class Web3Wrapper { * @return The amount in units. */ public static toUnitAmount(amount: BigNumber, decimals: number): BigNumber { - const aUnit = new BigNumber(10).pow(decimals); + const aUnit = new BigNumber(BASE_TEN).pow(decimals); const unit = amount.div(aUnit); return unit; } @@ -61,7 +63,7 @@ export class Web3Wrapper { * @return The amount in baseUnits. */ public static toBaseUnitAmount(amount: BigNumber, decimals: number): BigNumber { - const unit = new BigNumber(10).pow(decimals); + const unit = new BigNumber(BASE_TEN).pow(decimals); const baseUnitAmount = amount.times(unit); const hasDecimals = baseUnitAmount.decimalPlaces() !== 0; if (hasDecimals) { @@ -180,8 +182,8 @@ export class Web3Wrapper { public async doesContractExistAtAddressAsync(address: string): Promise { const code = await promisify(this._web3.eth.getCode)(address); // Regex matches 0x0, 0x00, 0x in order to accommodate poorly implemented clients - const codeIsEmpty = /^0x0{0,40}$/i.test(code); - return !codeIsEmpty; + const isCodeEmpty = /^0x0{0,40}$/i.test(code); + return !isCodeEmpty; } /** * Sign a message with a specific address's private key (`eth_sign`) @@ -336,16 +338,16 @@ export class Web3Wrapper { pollingIntervalMs: number = 1000, timeoutMs?: number, ): Promise { - let timeoutExceeded = false; + let wasTimeoutExceeded = false; if (timeoutMs) { - setTimeout(() => (timeoutExceeded = true), timeoutMs); + setTimeout(() => (wasTimeoutExceeded = true), timeoutMs); } const txReceiptPromise = new Promise( (resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => { const intervalId = intervalUtils.setAsyncExcludingInterval( async () => { - if (timeoutExceeded) { + if (wasTimeoutExceeded) { intervalUtils.clearAsyncExcludingInterval(intervalId); return reject(Web3WrapperErrors.TransactionMiningTimeout); } diff --git a/packages/website/ts/components/generate_order/new_token_form.tsx b/packages/website/ts/components/generate_order/new_token_form.tsx index 10f71b430..a9b8e9589 100644 --- a/packages/website/ts/components/generate_order/new_token_form.tsx +++ b/packages/website/ts/components/generate_order/new_token_form.tsx @@ -157,14 +157,14 @@ export class NewTokenForm extends React.Component maxLength) { nameErrText = `Max length is ${maxLength}`; - } else if (tokenWithNameExists) { + } else if (doesTokenWithNameExists) { nameErrText = 'Token with this name already exists'; } @@ -177,14 +177,14 @@ export class NewTokenForm extends React.Component maxLength) { symbolErrText = `Max length is ${maxLength}`; - } else if (tokenWithSymbolExists) { + } else if (doesTokenWithSymbolExists) { symbolErrText = 'Token with symbol already exists'; } diff --git a/packages/website/ts/components/relayer_index/relayer_index.tsx b/packages/website/ts/components/relayer_index/relayer_index.tsx index d4fd6aeaf..675e83c9f 100644 --- a/packages/website/ts/components/relayer_index/relayer_index.tsx +++ b/packages/website/ts/components/relayer_index/relayer_index.tsx @@ -56,8 +56,8 @@ export class RelayerIndex extends React.Component
Date: Wed, 16 May 2018 15:14:24 +0200 Subject: Improve name --- packages/json-schemas/test/schema_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 2e10fd71d..a275559b6 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -885,14 +885,14 @@ describe('Schema', () => { }); describe('#txDataSchema', () => { it('should validate valid txData', () => { - const bigNumGasAmt = new BigNumber(42); + const bigNumGasAmount = new BigNumber(42); const testCases = [ { from: NULL_ADDRESS, }, { from: NULL_ADDRESS, - gas: bigNumGasAmt, + gas: bigNumGasAmount, }, { from: NULL_ADDRESS, -- cgit v1.2.3 From b2f362225c5c03526852fc6b997241faba6d1231 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 15:14:31 +0200 Subject: Fix comments --- packages/tslint-config/rules/booleanNamingRule.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/tslint-config/rules/booleanNamingRule.ts b/packages/tslint-config/rules/booleanNamingRule.ts index bc0b42e71..f673afc6a 100644 --- a/packages/tslint-config/rules/booleanNamingRule.ts +++ b/packages/tslint-config/rules/booleanNamingRule.ts @@ -41,7 +41,7 @@ function checkNodeForViolations(ctx: Lint.WalkContext, node: ts.Node, tc: break; default: - // noop + _.noop(); } } @@ -53,7 +53,6 @@ function handleBooleanNaming( const nodeName = node.name; const variableName = nodeName.getText(); const lowercasedName = _.toLower(variableName); - // tslint:disable-next-line const typeNode = tc.getTypeAtLocation(node); const typeName = (typeNode as any).intrinsicName; if (typeName === 'boolean') { -- cgit v1.2.3 From cf7967e6296aac0a328143e92a22c5682541a576 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 17 May 2018 14:07:44 +0200 Subject: Disable magic number rule in more places where it isn't helping code readability --- .../contract-wrappers/test/order_validation_test.ts | 20 ++++++++++---------- .../sol-cov/test/collect_coverage_entries_test.ts | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/contract-wrappers/test/order_validation_test.ts b/packages/contract-wrappers/test/order_validation_test.ts index ed2159026..d9077d6e4 100644 --- a/packages/contract-wrappers/test/order_validation_test.ts +++ b/packages/contract-wrappers/test/order_validation_test.ts @@ -207,8 +207,8 @@ describe('OrderValidation', () => { takerAddress, fillableAmount, ); - const sixthIndex = 6; - const nonTakerAddress = userAddresses[sixthIndex]; + // tslint:disable-next-line:custom-no-magic-numbers + const nonTakerAddress = userAddresses[6]; return expect( contractWrappers.exchange.validateFillOrderThrowIfInvalidAsync( signedOrder, @@ -355,8 +355,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); expect( transferFromAsync .getCall(0) @@ -426,8 +426,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); expect( transferFromAsync .getCall(0) @@ -495,8 +495,8 @@ describe('OrderValidation', () => { takerAddress, zrxTokenAddress, ); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); const makerFillAmount = transferFromAsync.getCall(0).args[3]; expect(makerFillAmount).to.be.bignumber.equal(makerTokenAmount); }); @@ -523,8 +523,8 @@ describe('OrderValidation', () => { ); const makerPartialFee = makerFee.div(2); const takerPartialFee = takerFee.div(2); - const expectedCallCount = 4; - expect(transferFromAsync.callCount).to.be.equal(expectedCallCount); + // tslint:disable-next-line:custom-no-magic-numbers + expect(transferFromAsync.callCount).to.be.equal(4); const partialMakerFee = transferFromAsync.getCall(2).args[3]; expect(partialMakerFee).to.be.bignumber.equal(makerPartialFee); const partialTakerFee = transferFromAsync.getCall(3).args[3]; diff --git a/packages/sol-cov/test/collect_coverage_entries_test.ts b/packages/sol-cov/test/collect_coverage_entries_test.ts index f60a57cb7..4263ed197 100644 --- a/packages/sol-cov/test/collect_coverage_entries_test.ts +++ b/packages/sol-cov/test/collect_coverage_entries_test.ts @@ -39,15 +39,15 @@ describe('Collect coverage entries', () => { const coverageEntries = collectCoverageEntries(simpleStorageContract); const fnIds = _.keys(coverageEntries.fnMap); expect(coverageEntries.fnMap[fnIds[0]].name).to.be.equal('set'); - const setExpectedLineNumber = 5; - expect(coverageEntries.fnMap[fnIds[0]].line).to.be.equal(setExpectedLineNumber); + // tslint:disable-next-line:custom-no-magic-numbers + expect(coverageEntries.fnMap[fnIds[0]].line).to.be.equal(5); const setFunction = `function set(uint x) { storedData = x; }`; expect(getRange(simpleStorageContract, coverageEntries.fnMap[fnIds[0]].loc)).to.be.equal(setFunction); expect(coverageEntries.fnMap[fnIds[1]].name).to.be.equal('get'); - const getExpectedLineNumber = 8; - expect(coverageEntries.fnMap[fnIds[1]].line).to.be.equal(getExpectedLineNumber); + // tslint:disable-next-line:custom-no-magic-numbers + expect(coverageEntries.fnMap[fnIds[1]].line).to.be.equal(8); const getFunction = `function get() constant returns (uint retVal) { return storedData; }`; -- cgit v1.2.3 From 7fab7829071f5b60a6dad058c5a7b6d56f607b97 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 17 May 2018 14:07:55 +0200 Subject: Improve naming --- packages/sol-compiler/test/compiler_test.ts | 7 ++++--- packages/utils/src/abi_decoder.ts | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/sol-compiler/test/compiler_test.ts b/packages/sol-compiler/test/compiler_test.ts index c7747741f..324313347 100644 --- a/packages/sol-compiler/test/compiler_test.ts +++ b/packages/sol-compiler/test/compiler_test.ts @@ -38,12 +38,13 @@ describe('#Compiler', function(): void { const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); // The last 43 bytes of the binaries are metadata which may not be equivalent - const last43BytesIndex = -86; + const metadataByteLength = 43; + const metadataHexLength = metadataByteLength * 2; const unlinkedBinaryWithoutMetadata = exchangeArtifact.compilerOutput.evm.bytecode.object.slice( 2, - last43BytesIndex, + -metadataHexLength, ); - const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, last43BytesIndex); + const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -metadataHexLength); expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata); }); }); diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 654c7753b..c78bfa343 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -23,8 +23,8 @@ export class AbiDecoder { formatted = formatted.slice(2); } - const desiredLength = 40; - formatted = _.padStart(formatted, desiredLength, '0'); + const addressLength = 40; + formatted = _.padStart(formatted, addressLength, '0'); return `0x${formatted}`; } constructor(abiArrays: AbiDefinition[][]) { -- cgit v1.2.3 From 4ca8903a21d5a78ace5bff3fc5bbc917e369cbfe Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 21 May 2018 16:09:07 -0700 Subject: Add missing blockchainLifecycle calls to contracts tests --- packages/contracts/test/asset_proxy/authorizable.ts | 6 ++++++ packages/contracts/test/asset_proxy/proxies.ts | 6 ++++++ packages/contracts/test/ether_token.ts | 7 +++++++ packages/contracts/test/exchange/core.ts | 6 ++++++ packages/contracts/test/exchange/dispatcher.ts | 6 ++++++ packages/contracts/test/exchange/libs.ts | 6 ++++++ packages/contracts/test/exchange/signature_validator.ts | 6 ++++++ packages/contracts/test/exchange/transactions.ts | 6 ++++++ packages/contracts/test/exchange/wrapper.ts | 6 ++++++ packages/contracts/test/libraries/lib_bytes.ts | 6 ++++++ packages/contracts/test/multi_sig_with_time_lock.ts | 12 ++++++++++++ packages/contracts/test/token_registry.ts | 6 ++++++ packages/contracts/test/unlimited_allowance_token.ts | 6 ++++++ packages/contracts/test/zrx_token.ts | 6 ++++++ 14 files changed, 91 insertions(+) diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts index 636b9096b..bbdcfb742 100644 --- a/packages/contracts/test/asset_proxy/authorizable.ts +++ b/packages/contracts/test/asset_proxy/authorizable.ts @@ -19,6 +19,12 @@ describe('Authorizable', () => { let notOwner: string; let address: string; let authorizable: MixinAuthorizableContract; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); owner = address = accounts[0]; diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index e7ef9a0d3..e64482c8f 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -39,6 +39,12 @@ describe('Asset Transfer Proxies', () => { let zeroEx: ZeroEx; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, notAuthorized, exchangeAddress, makerAddress, takerAddress] = accounts); diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 418fbc45e..4c647bbc7 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -20,6 +20,13 @@ describe('EtherToken', () => { const gasPrice = ZeroEx.toBaseUnitAmount(new BigNumber(20), 9); let zeroEx: ZeroEx; let etherTokenAddress: string; + + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); account = accounts[0]; diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index be3252800..f4d83d07d 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -61,6 +61,12 @@ describe('Exchange core', () => { let zeroEx: ZeroEx; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, makerAddress, takerAddress, feeRecipientAddress] = accounts); diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index db2f18ddc..5713a0b4f 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -36,6 +36,12 @@ describe('AssetProxyDispatcher', () => { let erc20Wrapper: ERC20Wrapper; let erc721Wrapper: ERC721Wrapper; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { // Setup accounts & addresses const accounts = await web3Wrapper.getAvailableAddressesAsync(); diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts index 1036cb815..883de7a12 100644 --- a/packages/contracts/test/exchange/libs.ts +++ b/packages/contracts/test/exchange/libs.ts @@ -25,6 +25,12 @@ describe('Exchange libs', () => { let orderFactory: OrderFactory; let libs: TestLibsContract; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const makerAddress = accounts[0]; diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index 489ed32c5..b918cef60 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -25,6 +25,12 @@ describe('MixinSignatureValidator', () => { let orderFactory: OrderFactory; let signatureValidator: TestSignatureValidatorContract; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const makerAddress = accounts[0]; diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index 482475554..c98a3dee5 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -61,6 +61,12 @@ describe('Exchange transactions', () => { let zeroEx: ZeroEx; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, senderAddress, makerAddress, takerAddress, feeRecipientAddress] = accounts); diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 0b79308dd..099f6b656 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -56,6 +56,12 @@ describe('Exchange wrappers', () => { let zeroEx: ZeroEx; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, makerAddress, takerAddress, feeRecipientAddress] = accounts); diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index 5ed5c356f..a468255e9 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -32,6 +32,12 @@ describe('LibBytes', () => { const testBytes32 = '0x102030405060708090a0b0c0d0e0f0102030405060708090a0b0c0d0e0f01020'; const testUint256 = new BigNumber(testBytes32, 16); + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { // Setup accounts & addresses const accounts = await web3Wrapper.getAvailableAddressesAsync(); diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index 8e58006ac..784f41d24 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -45,6 +45,12 @@ describe('MultiSigWalletWithTimeLock', () => { describe('changeTimeLock', () => { describe('initially non-time-locked', async () => { + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before('deploy a wallet', async () => { multiSig = await MultiSigWalletWithTimeLockContract.deployFrom0xArtifactAsync( artifacts.MultiSigWalletWithTimeLock, @@ -140,6 +146,12 @@ describe('MultiSigWalletWithTimeLock', () => { }); }); describe('initially time-locked', async () => { + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before('deploy a wallet', async () => { multiSig = await MultiSigWalletWithTimeLockContract.deployFrom0xArtifactAsync( artifacts.MultiSigWalletWithTimeLock, diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts index 9e4f7ca3b..c14f64184 100644 --- a/packages/contracts/test/token_registry.ts +++ b/packages/contracts/test/token_registry.ts @@ -24,6 +24,12 @@ describe('TokenRegistry', () => { let notOwner: string; let tokenReg: TokenRegistryContract; let tokenRegWrapper: TokenRegWrapper; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); owner = accounts[0]; diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index 8851a04ef..6b79301bb 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -27,6 +27,12 @@ describe('UnlimitedAllowanceToken', () => { let tokenAddress: string; let token: DummyERC20TokenContract; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); owner = accounts[0]; diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts index 7a72f85dc..52322983f 100644 --- a/packages/contracts/test/zrx_token.ts +++ b/packages/contracts/test/zrx_token.ts @@ -26,6 +26,12 @@ describe('ZRXToken', () => { let zrxToken: ZRXTokenContract; let zrxAddress: string; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); owner = accounts[0]; -- cgit v1.2.3 From 2c496a92adaef4132f6b0a135e61bad7b26b18bd Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 21 May 2018 16:39:07 -0700 Subject: Add awaitTransactionMinedAsync after every sent transaction --- packages/contracts/src/utils/constants.ts | 1 + .../contracts/test/asset_proxy/authorizable.ts | 47 ++++-- packages/contracts/test/asset_proxy/proxies.ts | 85 +++++++---- packages/contracts/test/exchange/core.ts | 54 ++++--- packages/contracts/test/exchange/dispatcher.ts | 163 +++++++++++++-------- packages/contracts/test/exchange/transactions.ts | 5 +- packages/contracts/test/exchange/wrapper.ts | 54 ++++--- .../contracts/test/multi_sig_with_time_lock.ts | 12 +- packages/contracts/test/token_registry.ts | 23 ++- .../contracts/test/unlimited_allowance_token.ts | 5 +- 10 files changed, 294 insertions(+), 155 deletions(-) diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts index 3fd2a0a3b..b876bf6b5 100644 --- a/packages/contracts/src/utils/constants.ts +++ b/packages/contracts/src/utils/constants.ts @@ -20,6 +20,7 @@ export const constants = { INVALID_OPCODE: 'invalid opcode', REVERT: 'revert', TESTRPC_NETWORK_ID: 50, + AWAIT_TRANSACTION_MINED_MS: 100, MAX_ETHERTOKEN_WITHDRAW_GAS: 43000, MAX_TOKEN_TRANSFERFROM_GAS: 80000, MAX_TOKEN_APPROVE_GAS: 60000, diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts index bbdcfb742..52e9ea87f 100644 --- a/packages/contracts/test/asset_proxy/authorizable.ts +++ b/packages/contracts/test/asset_proxy/authorizable.ts @@ -48,12 +48,18 @@ describe('Authorizable', () => { ).to.be.rejectedWith(constants.REVERT); }); it('should allow owner to add an authorized address', async () => { - await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const isAuthorized = await authorizable.authorized.callAsync(address); expect(isAuthorized).to.be.true(); }); it('should throw if owner attempts to authorize a duplicate address', async () => { - await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); return expect( authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), ).to.be.rejectedWith(constants.REVERT); @@ -62,7 +68,10 @@ describe('Authorizable', () => { describe('removeAuthorizedAddress', () => { it('should throw if not called by owner', async () => { - await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); return expect( authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { from: notOwner, @@ -71,10 +80,16 @@ describe('Authorizable', () => { }); it('should allow owner to remove an authorized address', async () => { - await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }); - await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const isAuthorized = await authorizable.authorized.callAsync(address); expect(isAuthorized).to.be.false(); }); @@ -92,16 +107,22 @@ describe('Authorizable', () => { it('should return all authorized addresses', async () => { const initial = await authorizable.getAuthorizedAddresses.callAsync(); expect(initial).to.have.length(0); - await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const afterAdd = await authorizable.getAuthorizedAddresses.callAsync(); expect(afterAdd).to.have.length(1); expect(afterAdd).to.include(address); - await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await authorizable.removeAuthorizedAddress.sendTransactionAsync(address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const afterRemove = await authorizable.getAuthorizedAddresses.callAsync(); expect(afterRemove).to.have.length(0); }); diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index e64482c8f..27b7f3049 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -55,18 +55,24 @@ describe('Asset Transfer Proxies', () => { [zrxToken] = await erc20Wrapper.deployDummyTokensAsync(); erc20Proxy = await erc20Wrapper.deployProxyAsync(); await erc20Wrapper.setBalancesAndAllowancesAsync(); - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeAddress, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeAddress, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); [erc721Token] = await erc721Wrapper.deployDummyTokensAsync(); erc721Proxy = await erc721Wrapper.deployProxyAsync(); await erc721Wrapper.setBalancesAndAllowancesAsync(); const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721MakerTokenId = erc721Balances[makerAddress][erc721Token.address][0]; - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeAddress, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeAddress, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID, @@ -86,12 +92,15 @@ describe('Asset Transfer Proxies', () => { // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(10); - await erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, - makerAddress, - takerAddress, - amount, - { from: exchangeAddress }, + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.transferFrom.sendTransactionAsync( + encodedProxyMetadata, + makerAddress, + takerAddress, + amount, + { from: exchangeAddress }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); // Verify transfer was successful const newBalances = await erc20Wrapper.getBalancesAsync(); @@ -109,12 +118,15 @@ describe('Asset Transfer Proxies', () => { // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(0); - await erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, - makerAddress, - takerAddress, - amount, - { from: exchangeAddress }, + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.transferFrom.sendTransactionAsync( + encodedProxyMetadata, + makerAddress, + takerAddress, + amount, + { from: exchangeAddress }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); // Verify transfer was successful const newBalances = await erc20Wrapper.getBalancesAsync(); @@ -132,9 +144,12 @@ describe('Asset Transfer Proxies', () => { // Create allowance less than transfer amount. Set allowance on proxy. const allowance = new BigNumber(0); const transferAmount = new BigNumber(10); - await zrxToken.approve.sendTransactionAsync(erc20Proxy.address, allowance, { - from: makerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await zrxToken.approve.sendTransactionAsync(erc20Proxy.address, allowance, { + from: makerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); // Perform a transfer; expect this to fail. return expect( erc20Proxy.transferFrom.sendTransactionAsync( @@ -185,7 +200,7 @@ describe('Asset Transfer Proxies', () => { amounts, { from: exchangeAddress }, ); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const newBalances = await erc20Wrapper.getBalancesAsync(); expect(res.logs.length).to.equal(numTransfers); @@ -238,12 +253,15 @@ describe('Asset Transfer Proxies', () => { // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(1); - await erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, - makerAddress, - takerAddress, - amount, - { from: exchangeAddress }, + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Proxy.transferFrom.sendTransactionAsync( + encodedProxyMetadata, + makerAddress, + takerAddress, + amount, + { from: exchangeAddress }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); // Verify transfer was successful const newOwnerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); @@ -303,9 +321,12 @@ describe('Asset Transfer Proxies', () => { erc721MakerTokenId, ); // Remove transfer approval for makerAddress. - await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, false, { - from: makerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, false, { + from: makerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); // Perform a transfer; expect this to fail. const amount = new BigNumber(1); return expect( @@ -362,7 +383,7 @@ describe('Asset Transfer Proxies', () => { amounts, { from: exchangeAddress }, ); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(res.logs.length).to.equal(numTransfers); const newOwnerMakerAssetA = await erc721Token.ownerOf.callAsync(makerTokenIdA); diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index f4d83d07d..3b40ed652 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -99,12 +99,18 @@ describe('Exchange core', () => { await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }); - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); defaultMakerAssetAddress = erc20TokenA.address; defaultTakerAssetAddress = erc20TokenB.address; @@ -526,23 +532,35 @@ describe('Exchange core', () => { }); it('should throw if maker allowances are too low to fill order', async () => { - await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { - from: makerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { + from: makerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(constants.REVERT); - await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { - from: makerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { + from: makerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); }); it('should throw if taker allowances are too low to fill order', async () => { - await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { - from: takerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { + from: takerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(constants.REVERT); - await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { - from: takerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { + from: takerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); }); it('should not change erc20Balances if an order is expired', async () => { diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index 5713a0b4f..a1c37d8c8 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -62,12 +62,18 @@ describe('AssetProxyDispatcher', () => { provider, txDefaults, ); - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { - from: owner, - }); - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); }); beforeEach(async () => { await blockchainLifecycle.startAsync(); @@ -78,11 +84,14 @@ describe('AssetProxyDispatcher', () => { describe('registerAssetProxy', () => { it('should record proxy upon registration', async () => { const prevProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); @@ -91,21 +100,27 @@ describe('AssetProxyDispatcher', () => { it('should be able to record multiple proxies', async () => { // Record first proxy const prevERC20ProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevERC20ProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevERC20ProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); // Record another proxy const prevERC721ProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC721, - erc721Proxy.address, - prevERC721ProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC721, + erc721Proxy.address, + prevERC721ProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC721); expect(proxyAddress).to.be.equal(erc721Proxy.address); @@ -114,11 +129,14 @@ describe('AssetProxyDispatcher', () => { it('should replace proxy address upon re-registration', async () => { // Initial registration const prevProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); @@ -131,11 +149,14 @@ describe('AssetProxyDispatcher', () => { // Register new ERC20 Transfer Proxy contract const newAddress = newErc20TransferProxy.address; const currentAddress = erc20Proxy.address; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - newAddress, - currentAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + newAddress, + currentAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); // Verify new asset proxy has replaced initial version proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); @@ -145,11 +166,14 @@ describe('AssetProxyDispatcher', () => { it('should throw if registering with incorrect "currentAssetProxyAddress" field', async () => { // Initial registration const prevProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); @@ -167,21 +191,27 @@ describe('AssetProxyDispatcher', () => { it('should be able to reset proxy address to NULL', async () => { // Initial registration const prevProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); // The following transaction will reset the proxy address const newProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - newProxyAddress, - erc20Proxy.address, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + newProxyAddress, + erc20Proxy.address, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); const finalProxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(finalProxyAddress).to.be.equal(newProxyAddress); @@ -215,11 +245,14 @@ describe('AssetProxyDispatcher', () => { describe('getAssetProxy', () => { it('should return correct address of registered proxy', async () => { const prevProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); @@ -235,23 +268,29 @@ describe('AssetProxyDispatcher', () => { it('should dispatch transfer to registered proxy', async () => { // Register ERC20 proxy const prevProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevProxyAddress, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC20, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); // Construct metadata for ERC20 proxy const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(10); - await assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( - encodedProxyMetadata, - makerAddress, - takerAddress, - amount, - { from: owner }, + await web3Wrapper.awaitTransactionMinedAsync( + await assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( + encodedProxyMetadata, + makerAddress, + takerAddress, + amount, + { from: owner }, + ), + constants.AWAIT_TRANSACTION_MINED_MS, ); // Verify transfer was successful const newBalances = await erc20Wrapper.getBalancesAsync(); diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index c98a3dee5..798c8283b 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -90,7 +90,10 @@ describe('Exchange transactions', () => { exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); defaultMakerTokenAddress = erc20TokenA.address; defaultTakerTokenAddress = erc20TokenB.address; diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 099f6b656..caaceb460 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -94,12 +94,18 @@ describe('Exchange wrappers', () => { await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }); - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); defaultMakerAssetAddress = erc20TokenA.address; defaultTakerAssetAddress = erc20TokenB.address; @@ -257,13 +263,19 @@ describe('Exchange wrappers', () => { it('should not change erc20Balances if maker allowances are too low to fill order', async () => { const signedOrder = orderFactory.newSignedOrder(); - await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { - from: makerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { + from: makerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); - await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { - from: makerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { + from: makerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const newBalances = await erc20Wrapper.getBalancesAsync(); expect(newBalances).to.be.deep.equal(erc20Balances); @@ -271,13 +283,19 @@ describe('Exchange wrappers', () => { it('should not change erc20Balances if taker allowances are too low to fill order', async () => { const signedOrder = orderFactory.newSignedOrder(); - await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { - from: takerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, new BigNumber(0), { + from: takerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); - await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { - from: takerAddress, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { + from: takerAddress, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const newBalances = await erc20Wrapper.getBalancesAsync(); expect(newBalances).to.be.deep.equal(erc20Balances); diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index 784f41d24..e467df0d7 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -107,7 +107,7 @@ describe('MultiSigWalletWithTimeLock', () => { txId = log.args.transactionId; txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1] }); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(res.logs).to.have.length(2); const blockNum = await web3Wrapper.getBlockNumberAsync(); @@ -134,10 +134,12 @@ describe('MultiSigWalletWithTimeLock', () => { txId = log.args.transactionId; txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1] }); + await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(initialSecondsTimeLocked).to.be.equal(0); txHash = await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }); + await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const res = await zeroEx.awaitTransactionMinedAsync(txHash); expect(res.logs).to.have.length(2); @@ -181,7 +183,8 @@ describe('MultiSigWalletWithTimeLock', () => { txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1], }); - const confRes = await zeroEx.awaitTransactionMinedAsync(txHash); + await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const confRes = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(confRes.logs).to.have.length(2); }); const newSecondsTimeLocked = 0; @@ -193,7 +196,10 @@ describe('MultiSigWalletWithTimeLock', () => { it('should execute if it has enough confirmations and is past the time lock', async () => { await web3Wrapper.increaseTimeAsync(SECONDS_TIME_LOCKED.toNumber()); - await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }); + await web3Wrapper.awaitTransactionMinedAsync( + await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const secondsTimeLocked = new BigNumber(await multiSig.secondsTimeLocked.callAsync()); expect(secondsTimeLocked).to.be.bignumber.equal(newSecondsTimeLocked); diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts index c14f64184..308dee8e6 100644 --- a/packages/contracts/test/token_registry.ts +++ b/packages/contracts/test/token_registry.ts @@ -143,9 +143,12 @@ describe('TokenRegistry', () => { }); it('should change the token name when called by owner', async () => { - await tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const [newData, oldData] = await Promise.all([ tokenRegWrapper.getTokenByNameAsync(token2.name), tokenRegWrapper.getTokenByNameAsync(token1.name), @@ -182,7 +185,10 @@ describe('TokenRegistry', () => { }); it('should change the token symbol when called by owner', async () => { - await tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, { from: owner }); + await web3Wrapper.awaitTransactionMinedAsync( + await tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const [newData, oldData] = await Promise.all([ tokenRegWrapper.getTokenBySymbolAsync(token2.symbol), tokenRegWrapper.getTokenBySymbolAsync(token1.symbol), @@ -223,9 +229,12 @@ describe('TokenRegistry', () => { it('should remove token metadata when called by owner', async () => { const index = new BigNumber(0); - await tokenReg.removeToken.sendTransactionAsync(token1.address, index, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await tokenReg.removeToken.sendTransactionAsync(token1.address, index, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address); expect(tokenData).to.be.deep.equal(nullToken); }); diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index 6b79301bb..dfca09175 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -46,7 +46,10 @@ describe('UnlimitedAllowanceToken', () => { constants.DUMMY_TOKEN_DECIMALS, constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); - await token.mint.sendTransactionAsync(MAX_MINT_VALUE, { from: owner }); + await web3Wrapper.awaitTransactionMinedAsync( + await token.mint.sendTransactionAsync(MAX_MINT_VALUE, { from: owner }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); tokenAddress = token.address; }); beforeEach(async () => { -- cgit v1.2.3 From 4fa57f55e640d94099a9047cb23b5a003dc69068 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 21 May 2018 16:51:43 -0700 Subject: Fix some unhandled promise rejections --- packages/contracts/test/asset_proxy/proxies.ts | 4 ++-- packages/contracts/test/exchange/core.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index 27b7f3049..0f3080c99 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -221,7 +221,7 @@ describe('Asset Transfer Proxies', () => { const toAddresses = _.times(numTransfers, () => takerAddress); const amounts = _.times(numTransfers, () => amount); - expect( + return expect( erc20Proxy.batchTransferFrom.sendTransactionAsync( assetMetadata, fromAddresses, @@ -405,7 +405,7 @@ describe('Asset Transfer Proxies', () => { const toAddresses = _.times(numTransfers, () => takerAddress); const amounts = _.times(numTransfers, () => new BigNumber(1)); - expect( + return expect( erc721Proxy.batchTransferFrom.sendTransactionAsync( assetMetadata, fromAddresses, diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 3b40ed652..1edd44aff 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -538,7 +538,9 @@ describe('Exchange core', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(constants.REVERT); + await expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( + constants.REVERT, + ); await web3Wrapper.awaitTransactionMinedAsync( await erc20TokenA.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { from: makerAddress, @@ -554,7 +556,9 @@ describe('Exchange core', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(constants.REVERT); + await expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( + constants.REVERT, + ); await web3Wrapper.awaitTransactionMinedAsync( await erc20TokenB.approve.sendTransactionAsync(erc20Proxy.address, constants.INITIAL_ERC20_ALLOWANCE, { from: takerAddress, -- cgit v1.2.3 From a5d315ee2adac392875439f4902491559ad98c8b Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 21 May 2018 16:58:29 -0700 Subject: Apply changes to test/exchange/match_orders.ts --- packages/contracts/test/exchange/match_orders.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index 94cdf4598..b08b9e763 100644 --- a/packages/contracts/test/exchange/match_orders.ts +++ b/packages/contracts/test/exchange/match_orders.ts @@ -78,6 +78,12 @@ describe('matchOrders', () => { let zeroEx: ZeroEx; + before(async () => { + await blockchainLifecycle.startAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); before(async () => { // Create accounts const accounts = await web3Wrapper.getAvailableAddressesAsync(); @@ -119,12 +125,18 @@ describe('matchOrders', () => { await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); // Authorize ERC20 and ERC721 trades by exchange - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }); - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }); + await web3Wrapper.awaitTransactionMinedAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); + await web3Wrapper.awaitTransactionMinedAsync( + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + constants.AWAIT_TRANSACTION_MINED_MS, + ); // Set default addresses defaultERC20MakerAssetAddress = erc20TokenA.address; defaultERC20TakerAssetAddress = erc20TokenB.address; -- cgit v1.2.3 From c4a2f700172e8be367225d90a1c51cef8cf0d7dd Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 21 May 2018 18:36:06 -0700 Subject: Make lint run in parallel --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf45598b0..2d44e468e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "rebuild": "run-s clean build", "test": "wsrun test $PKG --serial --exclude-missing", "stage_docs": "wsrun docs:stage $PKG --parallel --exclude-missing", - "lint": "wsrun lint $PKG --exclude-missing" + "lint": "wsrun lint $PKG --parallel --exclude-missing" }, "config": { "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic" -- cgit v1.2.3 From 5cc2e8de7b73d9a0196f4593c412c0beb0a0fe56 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 13:45:18 +0200 Subject: Ignore classnames linter rule --- packages/contract_templates/contract.handlebars | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars index ed11ac8d2..41f46695b 100644 --- a/packages/contract_templates/contract.handlebars +++ b/packages/contract_templates/contract.handlebars @@ -31,6 +31,7 @@ export enum {{contractName}}Events { {{/if}} // tslint:disable:no-parameter-reassignment +// tslint:disable-next-line:class-name export class {{contractName}}Contract extends BaseContract { {{#each methods}} {{#this.constant}} -- cgit v1.2.3 From 1dad14f8ea0e463a699d5b2d5f8ccd9532b2ef19 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 13:50:07 +0200 Subject: Add missing return types --- packages/contracts/src/utils/erc20_wrapper.ts | 8 ++++---- packages/contracts/src/utils/erc721_wrapper.ts | 10 +++++----- packages/contracts/src/utils/exchange_wrapper.ts | 2 +- packages/contracts/src/utils/formatters.ts | 8 ++++---- packages/contracts/test/utils/match_order_tester.ts | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/contracts/src/utils/erc20_wrapper.ts b/packages/contracts/src/utils/erc20_wrapper.ts index f12571b48..0303649a5 100644 --- a/packages/contracts/src/utils/erc20_wrapper.ts +++ b/packages/contracts/src/utils/erc20_wrapper.ts @@ -23,7 +23,7 @@ export class ERC20Wrapper { } public async deployDummyTokensAsync(): Promise { this._dummyTokenContracts = await Promise.all( - _.times(constants.NUM_DUMMY_ERC20_TO_DEPLOY, () => + _.times(constants.NUM_DUMMY_ERC20_TO_DEPLOY, async () => DummyERC20TokenContract.deployFrom0xArtifactAsync( artifacts.DummyERC20Token, this._provider, @@ -45,7 +45,7 @@ export class ERC20Wrapper { ); return this._proxyContract; } - public async setBalancesAndAllowancesAsync() { + public async setBalancesAndAllowancesAsync(): Promise { this._validateDummyTokenContractsExistOrThrow(); this._validateProxyContractExistsOrThrow(); const setBalancePromises: Array> = []; @@ -103,12 +103,12 @@ export class ERC20Wrapper { const tokenAddresses = _.map(this._dummyTokenContracts, dummyTokenContract => dummyTokenContract.address); return tokenAddresses; } - private _validateDummyTokenContractsExistOrThrow() { + private _validateDummyTokenContractsExistOrThrow(): void { if (_.isUndefined(this._dummyTokenContracts)) { throw new Error('Dummy ERC20 tokens not yet deployed, please call "deployDummyTokensAsync"'); } } - private _validateProxyContractExistsOrThrow() { + private _validateProxyContractExistsOrThrow(): void { if (_.isUndefined(this._proxyContract)) { throw new Error('ERC20 proxy contract not yet deployed, please call "deployProxyAsync"'); } diff --git a/packages/contracts/src/utils/erc721_wrapper.ts b/packages/contracts/src/utils/erc721_wrapper.ts index 5b5de262f..36988ba31 100644 --- a/packages/contracts/src/utils/erc721_wrapper.ts +++ b/packages/contracts/src/utils/erc721_wrapper.ts @@ -25,7 +25,7 @@ export class ERC721Wrapper { } public async deployDummyTokensAsync(): Promise { this._dummyTokenContracts = await Promise.all( - _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY, () => + _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY, async () => DummyERC721TokenContract.deployFrom0xArtifactAsync( artifacts.DummyERC721Token, this._provider, @@ -45,7 +45,7 @@ export class ERC721Wrapper { ); return this._proxyContract; } - public async setBalancesAndAllowancesAsync() { + public async setBalancesAndAllowancesAsync(): Promise { this._validateDummyTokenContractsExistOrThrow(); this._validateProxyContractExistsOrThrow(); const setBalancePromises: Array> = []; @@ -125,17 +125,17 @@ export class ERC721Wrapper { const tokenAddresses = _.map(this._dummyTokenContracts, dummyTokenContract => dummyTokenContract.address); return tokenAddresses; } - private _validateDummyTokenContractsExistOrThrow() { + private _validateDummyTokenContractsExistOrThrow(): void { if (_.isUndefined(this._dummyTokenContracts)) { throw new Error('Dummy ERC721 tokens not yet deployed, please call "deployDummyTokensAsync"'); } } - private _validateProxyContractExistsOrThrow() { + private _validateProxyContractExistsOrThrow(): void { if (_.isUndefined(this._proxyContract)) { throw new Error('ERC721 proxy contract not yet deployed, please call "deployProxyAsync"'); } } - private _validateBalancesAndAllowancesSetOrThrow() { + private _validateBalancesAndAllowancesSetOrThrow(): void { if (_.keys(this._initialTokenIdsByOwner).length === 0) { throw new Error( 'Dummy ERC721 balances and allowances not yet set, please call "setBalancesAndAllowancesAsync"', diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index 46531fa3f..21e569f54 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -245,7 +245,7 @@ export class ExchangeWrapper { const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash); return tx; } - private async _getTxWithDecodedExchangeLogsAsync(txHash: string) { + private async _getTxWithDecodedExchangeLogsAsync(txHash: string): Promise { const tx = await this._zeroEx.awaitTransactionMinedAsync(txHash); tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address); tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log)); diff --git a/packages/contracts/src/utils/formatters.ts b/packages/contracts/src/utils/formatters.ts index e706c15b5..bfa48d6f1 100644 --- a/packages/contracts/src/utils/formatters.ts +++ b/packages/contracts/src/utils/formatters.ts @@ -5,7 +5,7 @@ import { orderUtils } from './order_utils'; import { BatchCancelOrders, BatchFillOrders, MarketBuyOrders, MarketSellOrders, SignedOrder } from './types'; export const formatters = { - createBatchFill(signedOrders: SignedOrder[], takerAssetFillAmounts: BigNumber[] = []) { + createBatchFill(signedOrders: SignedOrder[], takerAssetFillAmounts: BigNumber[] = []): BatchFillOrders { const batchFill: BatchFillOrders = { orders: [], signatures: [], @@ -21,7 +21,7 @@ export const formatters = { }); return batchFill; }, - createMarketSellOrders(signedOrders: SignedOrder[], takerAssetFillAmount: BigNumber) { + createMarketSellOrders(signedOrders: SignedOrder[], takerAssetFillAmount: BigNumber): MarketSellOrders { const marketSellOrders: MarketSellOrders = { orders: [], signatures: [], @@ -34,7 +34,7 @@ export const formatters = { }); return marketSellOrders; }, - createMarketBuyOrders(signedOrders: SignedOrder[], makerAssetFillAmount: BigNumber) { + createMarketBuyOrders(signedOrders: SignedOrder[], makerAssetFillAmount: BigNumber): MarketBuyOrders { const marketBuyOrders: MarketBuyOrders = { orders: [], signatures: [], @@ -47,7 +47,7 @@ export const formatters = { }); return marketBuyOrders; }, - createBatchCancel(signedOrders: SignedOrder[]) { + createBatchCancel(signedOrders: SignedOrder[]): BatchCancelOrders { const batchCancel: BatchCancelOrders = { orders: [], }; diff --git a/packages/contracts/test/utils/match_order_tester.ts b/packages/contracts/test/utils/match_order_tester.ts index 14930de08..da311e6ea 100644 --- a/packages/contracts/test/utils/match_order_tester.ts +++ b/packages/contracts/test/utils/match_order_tester.ts @@ -55,7 +55,7 @@ export class MatchOrderTester { realERC20BalancesByOwner: ERC20BalancesByOwner, expectedNewERC721TokenIdsByOwner: ERC721TokenIdsByOwner, realERC721TokenIdsByOwner: ERC721TokenIdsByOwner, - ) { + ): boolean { // ERC20 Balances const erc20BalancesMatch = _.isEqual(expectedNewERC20BalancesByOwner, realERC20BalancesByOwner); if (!erc20BalancesMatch) { -- cgit v1.2.3 From b39f75a2e328bc48e99a705973a7b364f3866719 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 14:52:06 +0200 Subject: Add CancelOrder and MatchOrder types --- packages/contracts/src/utils/order_utils.ts | 6 +++--- packages/contracts/src/utils/types.ts | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts index 7a482ad9e..8adc6b735 100644 --- a/packages/contracts/src/utils/order_utils.ts +++ b/packages/contracts/src/utils/order_utils.ts @@ -4,7 +4,7 @@ import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import { crypto } from './crypto'; -import { OrderStruct, SignatureType, SignedOrder, UnsignedOrder } from './types'; +import { CancelOrder, MatchOrder, OrderStruct, SignatureType, SignedOrder, UnsignedOrder } from './types'; export const orderUtils = { createFill: (signedOrder: SignedOrder, takerAssetFillAmount?: BigNumber) => { @@ -15,7 +15,7 @@ export const orderUtils = { }; return fill; }, - createCancel(signedOrder: SignedOrder, takerAssetCancelAmount?: BigNumber) { + createCancel(signedOrder: SignedOrder, takerAssetCancelAmount?: BigNumber): CancelOrder { const cancel = { order: orderUtils.getOrderStruct(signedOrder), takerAssetCancelAmount: takerAssetCancelAmount || signedOrder.takerAssetAmount, @@ -80,7 +80,7 @@ export const orderUtils = { const orderHashHex = `0x${orderHashBuff.toString('hex')}`; return orderHashHex; }, - createMatchOrders(signedOrderLeft: SignedOrder, signedOrderRight: SignedOrder) { + createMatchOrders(signedOrderLeft: SignedOrder, signedOrderRight: SignedOrder): MatchOrder { const fill = { left: orderUtils.getOrderStruct(signedOrderLeft), right: orderUtils.getOrderStruct(signedOrderRight), diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts index 8d81adece..ef86b4f38 100644 --- a/packages/contracts/src/utils/types.ts +++ b/packages/contracts/src/utils/types.ts @@ -197,3 +197,15 @@ export interface ProxyData { tokenAddress?: string; data?: any; } + +export interface CancelOrder { + order: OrderStruct; + takerAssetCancelAmount: BigNumber; +} + +export interface MatchOrder { + left: OrderStruct; + right: OrderStruct; + leftSignature: string; + rightSignature: string; +} -- cgit v1.2.3 From f657a3d811461cd7924fa1f949bcde610aa22fef Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 14:52:30 +0200 Subject: Upgrade UglifyJS to include ES6 support --- packages/website/package.json | 1 + packages/website/webpack.config.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 3ef66d269..8b34cd743 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -88,6 +88,7 @@ "tslint": "5.8.0", "tslint-config-0xproject": "^0.0.2", "typescript": "2.7.1", + "uglifyjs-webpack-plugin": "^1.2.5", "webpack": "^3.1.0", "webpack-dev-middleware": "^1.10.0", "webpack-dev-server": "^2.5.0" diff --git a/packages/website/webpack.config.js b/packages/website/webpack.config.js index e28e9e064..f9abeb27c 100644 --- a/packages/website/webpack.config.js +++ b/packages/website/webpack.config.js @@ -1,5 +1,6 @@ const path = require('path'); const webpack = require('webpack'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { entry: ['./ts/index.tsx'], @@ -76,9 +77,14 @@ module.exports = { NODE_ENV: JSON.stringify(process.env.NODE_ENV), }, }), - new webpack.optimize.UglifyJsPlugin({ - mangle: { - except: ['BigNumber'], + // TODO: Revert to webpack bundled version with webpack v4. + // The v3 series bundled version does not support ES6 and + // fails to build. + new UglifyJsPlugin({ + uglifyOptions: { + mangle: { + reserved: ['BigNumber'], + }, }, }), ] -- cgit v1.2.3 From 4a971be168469d17ac75be96dd77e773f2ce5473 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 15:13:38 +0200 Subject: Fix warnings in Metacoin --- packages/metacoin/contracts/Metacoin.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/metacoin/contracts/Metacoin.sol b/packages/metacoin/contracts/Metacoin.sol index ac212b32e..dc67e6242 100644 --- a/packages/metacoin/contracts/Metacoin.sol +++ b/packages/metacoin/contracts/Metacoin.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.21; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; contract Metacoin { @@ -16,7 +16,7 @@ contract Metacoin { uint32 callback; } - function Metacoin() public { + constructor () public { balances[msg.sender] = 10000; } @@ -24,7 +24,7 @@ contract Metacoin { if (balances[msg.sender] < transferData.amount) return false; balances[msg.sender] -= transferData.amount; balances[transferData.to] += transferData.amount; - Transfer(msg.sender, transferData.to, transferData.amount); + emit Transfer(msg.sender, transferData.to, transferData.amount); return true; } -- cgit v1.2.3 From 73c95c328dfff0332934ea3108f27dae47149566 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 17:08:47 +0200 Subject: Update yarn.lock --- yarn.lock | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6f1b7b931..91f02d901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2452,7 +2452,7 @@ commander@2.12.2: version "2.12.2" resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" -commander@2.13.0: +commander@2.13.0, commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" @@ -3636,7 +3636,7 @@ envinfo@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-4.4.2.tgz#472c49f3a8b9bca73962641ce7cb692bf623cd1c" -errno@^0.1.1, errno@^0.1.3, errno@~0.1.1: +errno@^0.1.1, errno@^0.1.3, errno@~0.1.1, errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" dependencies: @@ -11625,6 +11625,13 @@ ua-parser-js@^0.7.9: version "0.7.17" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" +uglify-es@^3.3.4: + version "3.3.9" + resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" + dependencies: + commander "~2.13.0" + source-map "~0.6.1" + uglify-js@^2.6, uglify-js@^2.8.29: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" @@ -11646,6 +11653,19 @@ uglifyjs-webpack-plugin@^0.4.6: uglify-js "^2.8.29" webpack-sources "^1.0.1" +uglifyjs-webpack-plugin@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz#2ef8387c8f1a903ec5e44fa36f9f3cbdcea67641" + dependencies: + cacache "^10.0.4" + find-cache-dir "^1.0.0" + schema-utils "^0.4.5" + serialize-javascript "^1.4.0" + source-map "^0.6.1" + uglify-es "^3.3.4" + webpack-sources "^1.1.0" + worker-farm "^1.5.2" + uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" @@ -12505,7 +12525,7 @@ webpack-node-externals@^1.6.0: version "1.7.2" resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.7.2.tgz#6e1ee79ac67c070402ba700ef033a9b8d52ac4e3" -webpack-sources@^1.0.1: +webpack-sources@^1.0.1, webpack-sources@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" dependencies: @@ -12642,6 +12662,12 @@ wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +worker-farm@^1.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + dependencies: + errno "~0.1.7" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" -- cgit v1.2.3 From 5456187dd03c0dd5eb141259541e7fe65f2c9ad8 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Tue, 22 May 2018 17:13:04 +0200 Subject: Update artifacts --- .../artifacts/1.0.0/DummyERC20Token.json | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/migrations/artifacts/1.0.0/DummyERC20Token.json b/packages/migrations/artifacts/1.0.0/DummyERC20Token.json index 808652210..3ac218e24 100644 --- a/packages/migrations/artifacts/1.0.0/DummyERC20Token.json +++ b/packages/migrations/artifacts/1.0.0/DummyERC20Token.json @@ -305,14 +305,14 @@ "evm": { "bytecode": { "linkReferences": {}, - "object": "0x60806040523480156200001157600080fd5b506040516200193b3803806200193b833981018060405262000037919081019062000228565b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600490805190602001906200009092919062000105565b508260059080519060200190620000a992919062000105565b508160068190555080600281905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505062000361565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014857805160ff191683800117855562000179565b8280016001018555821562000179579182015b82811115620001785782518255916020019190600101906200015b565b5b5090506200018891906200018c565b5090565b620001b191905b80821115620001ad57600081600090555060010162000193565b5090565b90565b600082601f8301121515620001c857600080fd5b8151620001df620001d982620002f4565b620002c6565b91508082526020830160208301858383011115620001fc57600080fd5b620002098382846200032b565b50505092915050565b600062000220825162000321565b905092915050565b600080600080608085870312156200023f57600080fd5b600085015167ffffffffffffffff8111156200025a57600080fd5b6200026887828801620001b4565b945050602085015167ffffffffffffffff8111156200028657600080fd5b6200029487828801620001b4565b9350506040620002a78782880162000212565b9250506060620002ba8782880162000212565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620002ea57600080fd5b8060405250919050565b600067ffffffffffffffff8211156200030c57600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b60005b838110156200034b5780820151818401526020810190506200032e565b838111156200035b576000848401525b50505050565b6115ca80620003716000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a72305820dbb48ab34f59e30595d90684cb2e3bf356f8749f5dd5e617ce527adda15d5c346c6578706572696d656e74616cf50037", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x193B CODESIZE SUB DUP1 PUSH3 0x193B DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x228 JUMP JUMPDEST CALLER PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x4 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x90 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP3 PUSH1 0x5 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0xA9 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP2 PUSH1 0x6 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP POP PUSH3 0x361 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x148 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x179 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x179 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x178 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x15B JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x188 SWAP2 SWAP1 PUSH3 0x18C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x1B1 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x1AD JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x193 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT ISZERO ISZERO PUSH3 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x1DF PUSH3 0x1D9 DUP3 PUSH3 0x2F4 JUMP JUMPDEST PUSH3 0x2C6 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x209 DUP4 DUP3 DUP5 PUSH3 0x32B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x220 DUP3 MLOAD PUSH3 0x321 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH3 0x23F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x25A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x268 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x286 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x294 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 PUSH3 0x2A7 DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 PUSH3 0x2BA DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP DUP2 DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH3 0x2EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x40 MSTORE POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH3 0x30C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x34B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH3 0x32E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x35B JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x15CA DUP1 PUSH3 0x371 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xdb 0xb4 DUP11 0xb3 0x4f MSIZE 0xe3 SDIV SWAP6 0xd9 MOD DUP5 0xcb 0x2e EXTCODESIZE RETURN JUMP 0xf8 PUSH21 0x9F5DD5E617CE527ADDA15D5C346C6578706572696D PUSH6 0x6E74616CF500 CALLDATACOPY ", + "object": "0x60806040523480156200001157600080fd5b506040516200193b3803806200193b833981018060405262000037919081019062000228565b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600490805190602001906200009092919062000105565b508260059080519060200190620000a992919062000105565b508160068190555080600281905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505062000361565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014857805160ff191683800117855562000179565b8280016001018555821562000179579182015b82811115620001785782518255916020019190600101906200015b565b5b5090506200018891906200018c565b5090565b620001b191905b80821115620001ad57600081600090555060010162000193565b5090565b90565b600082601f8301121515620001c857600080fd5b8151620001df620001d982620002f4565b620002c6565b91508082526020830160208301858383011115620001fc57600080fd5b620002098382846200032b565b50505092915050565b600062000220825162000321565b905092915050565b600080600080608085870312156200023f57600080fd5b600085015167ffffffffffffffff8111156200025a57600080fd5b6200026887828801620001b4565b945050602085015167ffffffffffffffff8111156200028657600080fd5b6200029487828801620001b4565b9350506040620002a78782880162000212565b9250506060620002ba8782880162000212565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620002ea57600080fd5b8060405250919050565b600067ffffffffffffffff8211156200030c57600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b60005b838110156200034b5780820151818401526020810190506200032e565b838111156200035b576000848401525b50505050565b6115ca80620003716000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a723058208f9c89c6f85f64aec1e07cbf745526bbd793fd4abc535035dd77ee4efbc898c36c6578706572696d656e74616cf50037", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x193B CODESIZE SUB DUP1 PUSH3 0x193B DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x228 JUMP JUMPDEST CALLER PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x4 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x90 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP3 PUSH1 0x5 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0xA9 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP2 PUSH1 0x6 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP POP PUSH3 0x361 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x148 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x179 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x179 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x178 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x15B JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x188 SWAP2 SWAP1 PUSH3 0x18C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x1B1 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x1AD JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x193 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT ISZERO ISZERO PUSH3 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x1DF PUSH3 0x1D9 DUP3 PUSH3 0x2F4 JUMP JUMPDEST PUSH3 0x2C6 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x209 DUP4 DUP3 DUP5 PUSH3 0x32B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x220 DUP3 MLOAD PUSH3 0x321 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH3 0x23F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x25A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x268 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x286 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x294 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 PUSH3 0x2A7 DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 PUSH3 0x2BA DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP DUP2 DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH3 0x2EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x40 MSTORE POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH3 0x30C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x34B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH3 0x32E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x35B JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x15CA DUP1 PUSH3 0x371 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 DUP16 SWAP13 DUP10 0xc6 0xf8 0x5f PUSH5 0xAEC1E07CBF PUSH21 0x5526BBD793FD4ABC535035DD77EE4EFBC898C36C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ", "sourceMap": "718:844:0:-;;;850:302;8:9:-1;5:2;;;30:1;27;20:12;5:2;850:302:0;;;;;;;;;;;;;;;;;;;;;;;;371:10:6;363:5;;:18;;;;;;;;;;;;;;;;;;1003:5:0;996:4;:12;;;;;;;;;;;;:::i;:::-;;1027:7;1018:6;:16;;;;;;;;;;;;:::i;:::-;;1055:9;1044:8;:20;;;;1088:12;1074:11;:26;;;;1133:12;1110:8;:20;1119:10;1110:20;;;;;;;;;;;;;;;:35;;;;850:302;;;;718:844;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6:444:-1:-;;119:3;112:4;104:6;100:17;96:27;89:35;86:2;;;137:1;134;127:12;86:2;167:6;161:13;189:65;204:49;246:6;204:49;;;189:65;;;180:74;;274:6;267:5;260:21;310:4;302:6;298:17;343:4;336:5;332:16;378:3;369:6;364:3;360:16;357:25;354:2;;;395:1;392;385:12;354:2;405:39;437:6;432:3;427;405:39;;;79:371;;;;;;;;458:122;;536:39;567:6;561:13;536:39;;;527:48;;521:59;;;;;587:870;;;;;773:3;761:9;752:7;748:23;744:33;741:2;;;790:1;787;780:12;741:2;846:1;835:9;831:17;825:24;869:18;861:6;858:30;855:2;;;901:1;898;891:12;855:2;921:74;987:7;978:6;967:9;963:22;921:74;;;911:84;;804:197;1053:2;1042:9;1038:18;1032:25;1077:18;1069:6;1066:30;1063:2;;;1109:1;1106;1099:12;1063:2;1129:74;1195:7;1186:6;1175:9;1171:22;1129:74;;;1119:84;;1011:198;1240:2;1258:64;1314:7;1305:6;1294:9;1290:22;1258:64;;;1248:74;;1219:109;1359:2;1377:64;1433:7;1424:6;1413:9;1409:22;1377:64;;;1367:74;;1338:109;735:722;;;;;;;;1464:256;;1526:2;1520:9;1510:19;;1564:4;1556:6;1552:17;1663:6;1651:10;1648:22;1627:18;1615:10;1612:34;1609:62;1606:2;;;1684:1;1681;1674:12;1606:2;1704:10;1700:2;1693:22;1504:216;;;;;1727:259;;1871:18;1863:6;1860:30;1857:2;;;1903:1;1900;1893:12;1857:2;1947:4;1943:9;1936:4;1928:6;1924:17;1920:33;1912:41;;1976:4;1970;1966:15;1958:23;;1794:192;;;;1993:79;;2062:5;2051:16;;2045:27;;;;2080:268;2145:1;2152:101;2166:6;2163:1;2160:13;2152:101;;;2242:1;2237:3;2233:11;2227:18;2223:1;2218:3;2214:11;2207:39;2188:2;2185:1;2181:10;2176:15;;2152:101;;;2268:6;2265:1;2262:13;2259:2;;;2333:1;2324:6;2319:3;2315:16;2308:27;2259:2;2129:219;;;;;718:844:0;;;;;;;" }, "deployedBytecode": { "linkReferences": {}, - "object": "0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a72305820dbb48ab34f59e30595d90684cb2e3bf356f8749f5dd5e617ce527adda15d5c346c6578706572696d656e74616cf50037", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xdb 0xb4 DUP11 0xb3 0x4f MSIZE 0xe3 SDIV SWAP6 0xd9 MOD DUP5 0xcb 0x2e EXTCODESIZE RETURN JUMP 0xf8 PUSH21 0x9F5DD5E617CE527ADDA15D5C346C6578706572696D PUSH6 0x6E74616CF500 CALLDATACOPY ", + "object": "0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a723058208f9c89c6f85f64aec1e07cbf745526bbd793fd4abc535035dd77ee4efbc898c36c6578706572696d656e74616cf50037", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 DUP16 SWAP13 DUP10 0xc6 0xf8 0x5f PUSH5 0xAEC1E07CBF PUSH21 0x5526BBD793FD4ABC535035DD77EE4EFBC898C36C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ", "sourceMap": "718:844:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;770:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;770:18:0;;;;;;;;;;;;;;;;;;;;2171:222:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2171:222:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1073:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1073:26:2;;;;;;;;;;;;;;;;;;;;1108:697:4;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1108:697:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:23:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:23:0;;;;;;;;;;;;;;;;;;;;2399:125:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2399:125:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;292:20:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;292:20:6;;;;;;;;;;;;;;;;;;;;794::0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;794:20:0;;;;;;;;;;;;;;;;;;;;905:321:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;905:321:1;;;;;;;;;;;;;;;;;;;1106:445:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1106:445:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2530:160;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2530:160:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1158:402:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1158:402:0;;;;;;;;;;;;;;;;;;;566:167:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;566:167:6;;;;;;;;;;;;;;;;;;;770:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2171:222:2:-;2254:4;2306:6;2274:7;:19;2282:10;2274:19;;;;;;;;;;;;;;;:29;2294:8;2274:29;;;;;;;;;;;;;;;:38;;;;2348:8;2327:38;;2336:10;2327:38;;;2358:6;2327:38;;;;;;;;;;;;;;;2382:4;2375:11;;2171:222;;;;:::o;1073:26::-;;;;:::o;1108:697:4:-;1206:4;1226:17;1246:7;:14;1254:5;1246:14;;;;;;;;;;;;;;;:26;1261:10;1246:26;;;;;;;;;;;;;;;;1226:46;;1322:6;1303:8;:15;1312:5;1303:15;;;;;;;;;;;;;;;;:25;;1342:20;;;;;;;;;;;;;;;;;;;;;;;1282:90;;;;;;;;;;;;;;;;;;;;;;;;;;;1416:6;1403:9;:19;;1436:22;;;;;;;;;;;;;;;;;;;;;;;1382:86;;;;;;;;;;;;;;;;;;;;;;;;;;;1525:8;:13;1534:3;1525:13;;;;;;;;;;;;;;;;1515:6;1499:8;:13;1508:3;1499:13;;;;;;;;;;;;;;;;:22;:39;;1552:8;;;;;;;;;;;;;;;;;;;;;;;1478:92;;;;;;;;;;;;;;;;;;;;;;;;;;;1597:6;1580:8;:13;1589:3;1580:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1632:6;1613:8;:15;1622:5;1613:15;;;;;;;;;;;;;;;;:25;;;;;;;;;;;762:10;1652:9;:20;1648:87;;;1718:6;1688:7;:14;1696:5;1688:14;;;;;;;;;;;;;;;:26;1703:10;1688:26;;;;;;;;;;;;;;;;:36;;;;;;;;;;;1648:87;1765:3;1749:28;;1758:5;1749:28;;;1770:6;1749:28;;;;;;;;;;;;;;;1794:4;1787:11;;1108:697;;;;;;:::o;820:23:0:-;;;;:::o;2399:125:2:-;2471:7;2501:8;:16;2510:6;2501:16;;;;;;;;;;;;;;;;2494:23;;2399:125;;;:::o;292:20:6:-;;;;;;;;;;;;;:::o;794::0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;905:321:1:-;995:21;985:6;:31;;964:133;;;;;;;;;;;;;;;;;;;;;;;;1130:37;1138:6;1146:8;:20;1155:10;1146:20;;;;;;;;;;;;;;;;1130:7;:37::i;:::-;1107:8;:20;1116:10;1107:20;;;;;;;;;;;;;;;:60;;;;1191:28;1199:11;;1212:6;1191:7;:28::i;:::-;1177:11;:42;;;;905:321;:::o;1106:445:2:-;1185:4;1250:6;1226:8;:20;1235:10;1226:20;;;;;;;;;;;;;;;;:30;;1270:20;;;;;;;;;;;;;;;;;;;;;;;1205:95;;;;;;;;;;;;;;;;;;;;;;;;;;;1357:8;:13;1366:3;1357:13;;;;;;;;;;;;;;;;1347:6;1331:8;:13;1340:3;1331:13;;;;;;;;;;;;;;;;:22;:39;;1384:8;;;;;;;;;;;;;;;;;;;;;;;1310:92;;;;;;;;;;;;;;;;;;;;;;;;;;;1436:6;1412:8;:20;1421:10;1412:20;;;;;;;;;;;;;;;;:30;;;;;;;;;;;1469:6;1452:8;:13;1461:3;1452:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1511:3;1490:33;;1499:10;1490:33;;;1516:6;1490:33;;;;;;;;;;;;;;;1540:4;1533:11;;1106:445;;;;:::o;2530:160::-;2628:7;2658;:15;2666:6;2658:15;;;;;;;;;;;;;;;:25;2674:8;2658:25;;;;;;;;;;;;;;;;2651:32;;2530:160;;;;:::o;1158:402:0:-;1258:19;460:5:6;;;;;;;;;;;446:19;;:10;:19;;;425:117;;;;;;;;;;;;;;;;;;;;;;;;1280:18:0;1290:7;1280:9;:18::i;:::-;1258:40;;1321:11;1312:6;:20;1308:210;;;1362:50;1370:11;;1383:28;1391:11;1404:6;1383:7;:28::i;:::-;1362:7;:50::i;:::-;1348:11;:64;;;;1308:210;;;1457:50;1465:11;;1478:28;1486:6;1494:11;1478:7;:28::i;:::-;1457:7;:50::i;:::-;1443:11;:64;;;;1308:210;1547:6;1527:8;:17;1536:7;1527:17;;;;;;;;;;;;;;;:26;;;;1158:402;;;:::o;566:167:6:-;460:5;;;;;;;;;;;446:19;;:10;:19;;;425:117;;;;;;;;;;;;;;;;;;;;;;;;682:1;662:22;;:8;:22;;;;658:69;;;708:8;700:5;;:16;;;;;;;;;;;;;;;;;;658:69;566:167;:::o;570:166:7:-;650:7;673:6;686:1;682;:5;673:14;;709:1;704;:6;;697:14;;;;;;728:1;721:8;;570:166;;;;;:::o;418:146::-;498:7;533:1;528;:6;;521:14;;;;;;556:1;552;:5;545:12;;418:146;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;;63:55;;57:66;;;;;130:118;;197:46;235:6;222:20;197:46;;;188:55;;182:66;;;;;255:241;;359:2;347:9;338:7;334:23;330:32;327:2;;;375:1;372;365:12;327:2;410:1;427:53;472:7;463:6;452:9;448:22;427:53;;;417:63;;389:97;321:175;;;;;503:366;;;624:2;612:9;603:7;599:23;595:32;592:2;;;640:1;637;630:12;592:2;675:1;692:53;737:7;728:6;717:9;713:22;692:53;;;682:63;;654:97;782:2;800:53;845:7;836:6;825:9;821:22;800:53;;;790:63;;761:98;586:283;;;;;;876:491;;;;1014:2;1002:9;993:7;989:23;985:32;982:2;;;1030:1;1027;1020:12;982:2;1065:1;1082:53;1127:7;1118:6;1107:9;1103:22;1082:53;;;1072:63;;1044:97;1172:2;1190:53;1235:7;1226:6;1215:9;1211:22;1190:53;;;1180:63;;1151:98;1280:2;1298:53;1343:7;1334:6;1323:9;1319:22;1298:53;;;1288:63;;1259:98;976:391;;;;;;1374:366;;;1495:2;1483:9;1474:7;1470:23;1466:32;1463:2;;;1511:1;1508;1501:12;1463:2;1546:1;1563:53;1608:7;1599:6;1588:9;1584:22;1563:53;;;1553:63;;1525:97;1653:2;1671:53;1716:7;1707:6;1696:9;1692:22;1671:53;;;1661:63;;1632:98;1457:283;;;;;;1747:241;;1851:2;1839:9;1830:7;1826:23;1822:32;1819:2;;;1867:1;1864;1857:12;1819:2;1902:1;1919:53;1964:7;1955:6;1944:9;1940:22;1919:53;;;1909:63;;1881:97;1813:175;;;;;1995:110;2068:31;2093:5;2068:31;;;2063:3;2056:44;2050:55;;;2112:101;2179:28;2201:5;2179:28;;;2174:3;2167:41;2161:52;;;2220:292;;2318:35;2347:5;2318:35;;;2370:6;2365:3;2358:19;2382:63;2438:6;2431:4;2426:3;2422:14;2415:4;2408:5;2404:16;2382:63;;;2477:29;2499:6;2477:29;;;2470:4;2465:3;2461:14;2457:50;2450:57;;2298:214;;;;;;2520:397;;2675:2;2670:3;2663:15;2712:66;2707:2;2702:3;2698:12;2691:88;2813:66;2808:2;2803:3;2799:12;2792:88;2908:2;2903:3;2899:12;2892:19;;2656:261;;;;2926:397;;3081:2;3076:3;3069:15;3118:66;3113:2;3108:3;3104:12;3097:88;3219:66;3214:2;3209:3;3205:12;3198:88;3314:2;3309:3;3305:12;3298:19;;3062:261;;;;3331:110;3404:31;3429:5;3404:31;;;3399:3;3392:44;3386:55;;;3448:193;;3556:2;3545:9;3541:18;3533:26;;3570:61;3628:1;3617:9;3613:17;3604:6;3570:61;;;3527:114;;;;;3648:181;;3750:2;3739:9;3735:18;3727:26;;3764:55;3816:1;3805:9;3801:17;3792:6;3764:55;;;3721:108;;;;;3836:273;;3960:2;3949:9;3945:18;3937:26;;4010:9;4004:4;4000:20;3996:1;3985:9;3981:17;3974:47;4035:64;4094:4;4085:6;4035:64;;;4027:72;;3931:178;;;;;4116:387;;4297:2;4286:9;4282:18;4274:26;;4347:9;4341:4;4337:20;4333:1;4322:9;4318:17;4311:47;4372:121;4488:4;4372:121;;;4364:129;;4268:235;;;;4510:387;;4691:2;4680:9;4676:18;4668:26;;4741:9;4735:4;4731:20;4727:1;4716:9;4712:17;4705:47;4766:121;4882:4;4766:121;;;4758:129;;4662:235;;;;4904:193;;5012:2;5001:9;4997:18;4989:26;;5026:61;5084:1;5073:9;5069:17;5060:6;5026:61;;;4983:114;;;;;5104:88;;5181:5;5175:12;5165:22;;5159:33;;;;5199:128;;5279:42;5272:5;5268:54;5257:65;;5251:76;;;;5334:92;;5414:5;5407:13;5400:21;5389:32;;5383:43;;;;5433:79;;5502:5;5491:16;;5485:27;;;;5519:128;;5599:42;5592:5;5588:54;5577:65;;5571:76;;;;5654:79;;5723:5;5712:16;;5706:27;;;;5741:268;5806:1;5813:101;5827:6;5824:1;5821:13;5813:101;;;5903:1;5898:3;5894:11;5888:18;5884:1;5879:3;5875:11;5868:39;5849:2;5846:1;5842:10;5837:15;;5813:101;;;5929:6;5926:1;5923:13;5920:2;;;5994:1;5985:6;5980:3;5976:16;5969:27;5920:2;5790:219;;;;;6017:97;;6105:2;6101:7;6096:2;6089:5;6085:14;6081:28;6071:38;;6065:49;;;" } } @@ -344,19 +344,19 @@ } }, "sourceCodes": { - "current/test/DummyERC20Token/DummyERC20Token.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"../Mintable/Mintable.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\ncontract DummyERC20Token is Mintable, Ownable {\n string public name;\n string public symbol;\n uint256 public decimals;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply)\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n function setBalance(address _target, uint256 _value)\n public\n onlyOwner\n {\n uint256 currBalance = balanceOf(_target);\n if (_value < currBalance) {\n totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));\n } else {\n totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n}\n", - "current/test/Mintable/Mintable.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n/*\n * Mintable\n * Base contract that creates a mintable UnlimitedAllowanceToken\n */\ncontract Mintable is UnlimitedAllowanceToken, SafeMath {\n function mint(uint256 _value)\n public\n {\n require(\n _value <= 100000000000000000000,\n \"Minting more than 100000000000000000000 is not allowed.\"\n );\n balances[msg.sender] = safeAdd(_value, balances[msg.sender]);\n totalSupply = safeAdd(totalSupply, _value);\n }\n}\n", - "current/tokens/ERC20Token/ERC20Token.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"./IERC20Token.sol\";\n\ncontract ERC20Token is IERC20Token {\n\n string constant INSUFFICIENT_BALANCE = \"Insufficient balance to complete transfer.\";\n string constant INSUFFICIENT_ALLOWANCE = \"Insufficient allowance to complete transfer.\";\n string constant OVERFLOW = \"Transfer would result in an overflow.\";\n\n mapping (address => uint256) balances;\n mapping (address => mapping (address => uint256)) allowed;\n\n uint256 public totalSupply;\n\n function transfer(address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n emit Transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowed[_from][msg.sender] >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function approve(address _spender, uint256 _value)\n public\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function balanceOf(address _owner)\n public view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n function allowance(address _owner, address _spender)\n public\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n\n", - "current/tokens/ERC20Token/IERC20Token.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.4.23;\npragma experimental ABIEncoderV2;\n\ncontract IERC20Token {\n\n /// @notice send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint256 _value)\n public\n returns (bool);\n\n /// @notice send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool);\n \n /// @notice `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint256 _value)\n public\n returns (bool);\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner)\n public view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n public view\n returns (uint256);\n\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n \n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n}\n", - "current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\ncontract UnlimitedAllowanceToken is ERC20Token {\n\n uint256 constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowance >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n emit Transfer(_from, _to, _value);\n return true;\n }\n}\n", - "current/utils/Ownable/IOwnable.sol": "pragma solidity ^0.4.23;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n", - "current/utils/Ownable/Ownable.sol": "pragma solidity ^0.4.23;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only contract owner is allowed to call this method.\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n", - "current/utils/SafeMath/SafeMath.sol": "pragma solidity ^0.4.23;\npragma experimental ABIEncoderV2;\n\ncontract SafeMath {\n function safeMul(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a * b;\n assert(a == 0 || c / a == b);\n return c;\n }\n\n function safeDiv(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a / b;\n return c;\n }\n\n function safeSub(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n assert(b <= a);\n return a - b;\n }\n\n function safeAdd(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a + b;\n assert(c >= a);\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n" + "current/test/DummyERC20Token/DummyERC20Token.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../Mintable/Mintable.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\ncontract DummyERC20Token is Mintable, Ownable {\n string public name;\n string public symbol;\n uint256 public decimals;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply)\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n function setBalance(address _target, uint256 _value)\n public\n onlyOwner\n {\n uint256 currBalance = balanceOf(_target);\n if (_value < currBalance) {\n totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));\n } else {\n totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n}\n", + "current/test/Mintable/Mintable.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n/*\n * Mintable\n * Base contract that creates a mintable UnlimitedAllowanceToken\n */\ncontract Mintable is UnlimitedAllowanceToken, SafeMath {\n function mint(uint256 _value)\n public\n {\n require(\n _value <= 100000000000000000000,\n \"Minting more than 100000000000000000000 is not allowed.\"\n );\n balances[msg.sender] = safeAdd(_value, balances[msg.sender]);\n totalSupply = safeAdd(totalSupply, _value);\n }\n}\n", + "current/tokens/ERC20Token/ERC20Token.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IERC20Token.sol\";\n\ncontract ERC20Token is IERC20Token {\n\n string constant INSUFFICIENT_BALANCE = \"Insufficient balance to complete transfer.\";\n string constant INSUFFICIENT_ALLOWANCE = \"Insufficient allowance to complete transfer.\";\n string constant OVERFLOW = \"Transfer would result in an overflow.\";\n\n mapping (address => uint256) balances;\n mapping (address => mapping (address => uint256)) allowed;\n\n uint256 public totalSupply;\n\n function transfer(address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n emit Transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowed[_from][msg.sender] >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function approve(address _spender, uint256 _value)\n public\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function balanceOf(address _owner)\n public view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n function allowance(address _owner, address _spender)\n public\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n\n", + "current/tokens/ERC20Token/IERC20Token.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.4.24;\npragma experimental ABIEncoderV2;\n\ncontract IERC20Token {\n\n /// @notice send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint256 _value)\n public\n returns (bool);\n\n /// @notice send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool);\n \n /// @notice `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint256 _value)\n public\n returns (bool);\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner)\n public view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n public view\n returns (uint256);\n\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n \n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n}\n", + "current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\ncontract UnlimitedAllowanceToken is ERC20Token {\n\n uint256 constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowance >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n emit Transfer(_from, _to, _value);\n return true;\n }\n}\n", + "current/utils/Ownable/IOwnable.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n", + "current/utils/Ownable/Ownable.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only contract owner is allowed to call this method.\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n", + "current/utils/SafeMath/SafeMath.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\ncontract SafeMath {\n function safeMul(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a * b;\n assert(a == 0 || c / a == b);\n return c;\n }\n\n function safeDiv(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a / b;\n return c;\n }\n\n function safeSub(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n assert(b <= a);\n return a - b;\n }\n\n function safeAdd(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a + b;\n assert(c >= a);\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n" }, - "sourceTreeHashHex": "0x72097ec50fe2cc41973383063c508ca0864d63f9cd33cd7f21e29639c07efa15", + "sourceTreeHashHex": "0x4830433daa189b8c48beea455c8f20379bb7b5a33b1607b73e3938501a24bd2b", "compiler": { "name": "solc", - "version": "0.4.23", + "version": "0.4.24", "settings": { "outputSelection": { "*": { -- cgit v1.2.3 From ab9cfd293b3ccc2aacb4238aebe2b033e55b7935 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 09:21:20 -0700 Subject: remove generated contract_wrappers during clean --- packages/migrations/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/migrations/package.json b/packages/migrations/package.json index bbd5f32e7..16b61d121 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -12,7 +12,7 @@ "prebuild": "run-s clean compile copy_artifacts generate_contract_wrappers", "copy_artifacts": "copyfiles 'artifacts/1.0.0/**/*' ./lib", "build": "tsc", - "clean": "shx rm -rf lib", + "clean": "shx rm -rf lib src/contract_wrappers", "lint": "tslint --project .", "migrate": "run-s build compile script:migrate", "script:migrate": "node ./lib/migrate.js", -- cgit v1.2.3 From d3e086c8500b5594166f0452d4f444e4852fcb8b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 09:50:37 -0700 Subject: Change publish command name --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2d44e468e..48ff3939a 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc", "report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls", "test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js", - "publish": "run-s install:all rebuild script:publish", - "publish:dry": "run-s install:all rebuild script:publish:dry", + "run:publish": "run-s install:all rebuild script:publish", + "run:publish:dry": "run-s install:all rebuild script:publish:dry", "script:publish": "node ./packages/monorepo-scripts/lib/publish.js", "script:publish:dry": "IS_DRY_RUN=true yarn script:publish", "install:all": "yarn install", -- cgit v1.2.3 From 1a35107a1d14aa5b6296d3d5230a8930a28b7540 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:16:38 -0700 Subject: Updated CHANGELOGS --- packages/0x.js/CHANGELOG.json | 3 ++- packages/0x.js/CHANGELOG.md | 7 ++++++- packages/abi-gen/CHANGELOG.json | 3 ++- packages/abi-gen/CHANGELOG.md | 6 +++++- packages/assert/CHANGELOG.json | 9 +++++++++ packages/assert/CHANGELOG.md | 6 +++++- packages/base-contract/CHANGELOG.json | 9 +++++++++ packages/base-contract/CHANGELOG.md | 6 +++++- packages/connect/CHANGELOG.json | 9 +++++++++ packages/connect/CHANGELOG.md | 6 +++++- packages/contract-wrappers/CHANGELOG.json | 10 ++++++++++ packages/contract-wrappers/CHANGELOG.md | 8 ++++++++ packages/dev-utils/CHANGELOG.json | 3 ++- packages/dev-utils/CHANGELOG.md | 6 +++++- packages/fill-scenarios/CHANGELOG.json | 10 ++++++++++ packages/fill-scenarios/CHANGELOG.md | 14 ++++++++++++++ packages/json-schemas/CHANGELOG.json | 9 +++++++++ packages/json-schemas/CHANGELOG.md | 6 +++++- packages/migrations/CHANGELOG.json | 9 +++++++++ packages/migrations/CHANGELOG.md | 6 +++++- packages/monorepo-scripts/CHANGELOG.json | 9 +++++++++ packages/monorepo-scripts/CHANGELOG.md | 4 ++++ packages/order-utils/CHANGELOG.json | 6 ++---- packages/order-utils/CHANGELOG.md | 6 +++++- packages/order-watcher/CHANGELOG.json | 10 ++++++++++ packages/order-watcher/CHANGELOG.md | 14 ++++++++++++++ packages/react-docs/CHANGELOG.json | 9 +++++++++ packages/react-docs/CHANGELOG.md | 6 +++++- packages/react-shared/CHANGELOG.json | 9 +++++++++ packages/react-shared/CHANGELOG.md | 6 +++++- packages/sol-compiler/CHANGELOG.json | 3 ++- packages/sol-compiler/CHANGELOG.md | 6 +++++- packages/sol-cov/CHANGELOG.json | 9 +++++++++ packages/sol-cov/CHANGELOG.md | 6 +++++- packages/sol-resolver/CHANGELOG.json | 9 +++++++++ packages/sol-resolver/CHANGELOG.md | 6 +++++- packages/sra-report/CHANGELOG.json | 3 ++- packages/sra-report/CHANGELOG.md | 6 +++++- packages/subproviders/CHANGELOG.json | 9 +++++++++ packages/subproviders/CHANGELOG.md | 6 +++++- packages/tslint-config/CHANGELOG.json | 9 +++++++++ packages/tslint-config/CHANGELOG.md | 4 ++++ packages/types/CHANGELOG.json | 3 ++- packages/types/CHANGELOG.md | 6 +++++- packages/typescript-typings/CHANGELOG.json | 9 +++++++++ packages/typescript-typings/CHANGELOG.md | 6 +++++- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 6 +++++- packages/web3-wrapper/CHANGELOG.json | 9 +++++++++ packages/web3-wrapper/CHANGELOG.md | 6 +++++- 50 files changed, 324 insertions(+), 30 deletions(-) create mode 100644 packages/fill-scenarios/CHANGELOG.md create mode 100644 packages/order-watcher/CHANGELOG.md diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index 5e4a726b1..2a219180d 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -11,7 +11,8 @@ "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage", "pr": 579 } - ] + ], + "timestamp": 1527008270 }, { "timestamp": 1525477860, diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index 353e0de29..f7ceaa552 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -5,7 +5,12 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.37.2 - _May 5, 2018_ +## v0.38.0 - _May 22, 2018_ + + * Renamed createOrderStateWatcher to createOrderWatcherAsync since it is now async (#579) + * Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage (#579) + +## v0.37.2 - _May 4, 2018_ * Dependencies updated diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index 4b23b8118..71cbaac1e 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Properly export the executable binary", "pr": 588 } - ] + ], + "timestamp": 1527008270 }, { "timestamp": 1525477860, diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index 803414e14..bcd807a3c 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.2.13 - _May 5, 2018_ +## v0.3.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.2.13 - _May 4, 2018_ * Dependencies updated diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index f826c7675..048763732 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008270, + "version": "0.2.10", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.2.9", diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md index ab058b9fc..974ac5c42 100644 --- a/packages/assert/CHANGELOG.md +++ b/packages/assert/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.2.9 - _May 5, 2018_ +## v0.2.10 - _May 22, 2018_ + + * Dependencies updated + +## v0.2.9 - _May 4, 2018_ * Dependencies updated diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index 106c26989..04029576c 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008270, + "version": "0.3.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.3.1", diff --git a/packages/base-contract/CHANGELOG.md b/packages/base-contract/CHANGELOG.md index b57bd5fc0..90ad066b5 100644 --- a/packages/base-contract/CHANGELOG.md +++ b/packages/base-contract/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.3.1 - _May 5, 2018_ +## v0.3.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.3.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index dd172e975..58fcc635b 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008270, + "version": "0.6.13", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.6.12", diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 4e118de38..acc6f33bd 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.12 - _May 5, 2018_ +## v0.6.13 - _May 22, 2018_ + + * Dependencies updated + +## v0.6.12 - _May 4, 2018_ * Dependencies updated diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 18ca4143e..84e773933 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "version": "0.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1527008544 + }, + { + "timestamp": 1527008270, "version": "0.0.1", "changes": [ { diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md index 5565d6210..c8a0145d5 100644 --- a/packages/contract-wrappers/CHANGELOG.md +++ b/packages/contract-wrappers/CHANGELOG.md @@ -4,3 +4,11 @@ Edit the package's CHANGELOG.json file only. --> CHANGELOG + +## v0.0.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.1 - _May 22, 2018_ + + * Moved contractWrappers out of 0x.js (#579) diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index 3f70a93cc..19f2591d2 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Move callbackErrorReporter over from 0x.js", "pr": 579 } - ] + ], + "timestamp": 1527008544 }, { "timestamp": 1525477860, diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index ab824c898..8e2f007d2 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.4.1 - _May 5, 2018_ +## v0.4.2 - _May 22, 2018_ + + * Move callbackErrorReporter over from 0x.js (#579) + +## v0.4.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json index 3cbba3ecb..c97cc7dd8 100644 --- a/packages/fill-scenarios/CHANGELOG.json +++ b/packages/fill-scenarios/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "timestamp": 1527008544, + "version": "0.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1527008544, "version": "0.0.1", "changes": [ { diff --git a/packages/fill-scenarios/CHANGELOG.md b/packages/fill-scenarios/CHANGELOG.md new file mode 100644 index 000000000..b32b8a289 --- /dev/null +++ b/packages/fill-scenarios/CHANGELOG.md @@ -0,0 +1,14 @@ + + +CHANGELOG + +## v0.0.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.1 - _May 22, 2018_ + + * Move FillScenarios out of 0x.js (#579) diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 4114cdcf4..ea0df7eb7 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008794, + "version": "0.7.24", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.7.23", diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index 257d14fdf..0b35f2408 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.7.23 - _May 5, 2018_ +## v0.7.24 - _May 22, 2018_ + + * Dependencies updated + +## v0.7.23 - _May 4, 2018_ * Dependencies updated diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 142468dad..f22d4a77f 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008794, + "version": "0.0.6", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.5", diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md index 99da91a35..78d915b6c 100644 --- a/packages/migrations/CHANGELOG.md +++ b/packages/migrations/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.5 - _May 5, 2018_ +## v0.0.6 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.5 - _May 4, 2018_ * Dependencies updated diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json index 10fe8acb1..58d946cd6 100644 --- a/packages/monorepo-scripts/CHANGELOG.json +++ b/packages/monorepo-scripts/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008794, + "version": "0.1.20", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525428773, "version": "0.1.19", diff --git a/packages/monorepo-scripts/CHANGELOG.md b/packages/monorepo-scripts/CHANGELOG.md index df70792b8..db5afd5af 100644 --- a/packages/monorepo-scripts/CHANGELOG.md +++ b/packages/monorepo-scripts/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.1.20 - _May 22, 2018_ + + * Dependencies updated + ## v0.1.19 - _May 4, 2018_ * Dependencies updated diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index 9399379fa..1bdb25347 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -3,13 +3,11 @@ "version": "0.0.5", "changes": [ { - "note": "Add formatters package for converting signedOrder to orderAddresses & orderValues", - "note": "Add RemainingFillableCalculator to calculate the remaining fillable amount of an order", - "note": "Add AbstractBalanceAndProxyAllowanceFetcher and AbstractOrderFilledCancelledFetcher", "note": "Add orderStateUtils, a module for computing order state needed to decide if an order is still valid" } - ] + ], + "timestamp": 1527008794 }, { "timestamp": 1525477860, diff --git a/packages/order-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md index d0bb706aa..5b10c13bc 100644 --- a/packages/order-utils/CHANGELOG.md +++ b/packages/order-utils/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.4 - _May 5, 2018_ +## v0.0.5 - _May 22, 2018_ + + * Add orderStateUtils, a module for computing order state needed to decide if an order is still valid + +## v0.0.4 - _May 4, 2018_ * Dependencies updated diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 87f40bcb7..dde78445a 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "timestamp": 1527008794, + "version": "0.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1527008794, "version": "0.0.1", "changes": [ { diff --git a/packages/order-watcher/CHANGELOG.md b/packages/order-watcher/CHANGELOG.md new file mode 100644 index 000000000..999d62f44 --- /dev/null +++ b/packages/order-watcher/CHANGELOG.md @@ -0,0 +1,14 @@ + + +CHANGELOG + +## v0.0.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.1 - _May 22, 2018_ + + * Moved OrderWatcher out of 0x.js package (#579) diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 0cb767dfc..32fa49264 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.0.12", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.11", diff --git a/packages/react-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md index 8a0afbeed..e46198f6c 100644 --- a/packages/react-docs/CHANGELOG.md +++ b/packages/react-docs/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.11 - _May 5, 2018_ +## v0.0.12 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.11 - _May 4, 2018_ * Dependencies updated diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json index 1095c78ee..1ef6bc2cd 100644 --- a/packages/react-shared/CHANGELOG.json +++ b/packages/react-shared/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.1.7", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.1.6", diff --git a/packages/react-shared/CHANGELOG.md b/packages/react-shared/CHANGELOG.md index 51d804b63..68eac96cf 100644 --- a/packages/react-shared/CHANGELOG.md +++ b/packages/react-shared/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.1.6 - _May 5, 2018_ +## v0.1.7 - _May 22, 2018_ + + * Dependencies updated + +## v0.1.6 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index a1b53fb9e..c558a98c5 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Properly export the executable binary", "pr": 588 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/sol-compiler/CHANGELOG.md b/packages/sol-compiler/CHANGELOG.md index 4eb0ed453..ee9b53f4e 100644 --- a/packages/sol-compiler/CHANGELOG.md +++ b/packages/sol-compiler/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.4.3 - _May 5, 2018_ +## v0.5.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.4.3 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index 468957fe3..ac53c9d7d 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.0.11", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.10", diff --git a/packages/sol-cov/CHANGELOG.md b/packages/sol-cov/CHANGELOG.md index 9e2995328..f0312d297 100644 --- a/packages/sol-cov/CHANGELOG.md +++ b/packages/sol-cov/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.10 - _May 5, 2018_ +## v0.0.11 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.10 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index 0126fa170..44de3825e 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.0.5", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.4", diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md index 4780544fa..bd94b1b41 100644 --- a/packages/sol-resolver/CHANGELOG.md +++ b/packages/sol-resolver/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.4 - _May 5, 2018_ +## v0.0.5 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.4 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sra-report/CHANGELOG.json b/packages/sra-report/CHANGELOG.json index 90a807c85..015279157 100644 --- a/packages/sra-report/CHANGELOG.json +++ b/packages/sra-report/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Properly export the executable binary", "pr": 588 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/sra-report/CHANGELOG.md b/packages/sra-report/CHANGELOG.md index e390e76ef..208a1e174 100644 --- a/packages/sra-report/CHANGELOG.md +++ b/packages/sra-report/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.14 - _May 5, 2018_ +## v0.1.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.0.14 - _May 4, 2018_ * Dependencies updated diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json index 799c2c99a..d3bf79ac4 100644 --- a/packages/subproviders/CHANGELOG.json +++ b/packages/subproviders/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.10.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.10.1", diff --git a/packages/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md index 22a5f90e8..8c4990a7c 100644 --- a/packages/subproviders/CHANGELOG.md +++ b/packages/subproviders/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.10.1 - _May 5, 2018_ +## v0.10.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.10.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json index ac59f7b19..4868b3983 100644 --- a/packages/tslint-config/CHANGELOG.json +++ b/packages/tslint-config/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.4.18", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525428773, "version": "0.4.17", diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md index 6f5042a52..56b65cadd 100644 --- a/packages/tslint-config/CHANGELOG.md +++ b/packages/tslint-config/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.4.18 - _May 22, 2018_ + + * Dependencies updated + ## v0.4.17 - _May 4, 2018_ * Dependencies updated diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index afcfd862c..23325fedc 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -7,7 +7,8 @@ "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", "pr": 579 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index edfd42269..68e5ed438 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.3 - _May 5, 2018_ +## v0.7.0 - _May 22, 2018_ + + * Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js (#579) + +## v0.6.3 - _May 4, 2018_ * Dependencies updated diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index 84b92b56c..2e2998bb3 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.3.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.3.1", diff --git a/packages/typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md index ad7622071..e12ce63f2 100644 --- a/packages/typescript-typings/CHANGELOG.md +++ b/packages/typescript-typings/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.3.1 - _May 5, 2018_ +## v0.3.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.3.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index d3c7da7b9..853acae55 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.6.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.6.1", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 92e466b17..0c01bf4f1 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.1 - _May 5, 2018_ +## v0.6.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.6.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 35e4383fd..b753ffbac 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.6.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.6.3", diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index 3358c9a01..4b8fb7bac 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.3 - _May 5, 2018_ +## v0.6.4 - _May 22, 2018_ + + * Dependencies updated + +## v0.6.3 - _May 4, 2018_ * Dependencies updated -- cgit v1.2.3 From b9e1c3c34faaac017e041a671e1e01617cff6043 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:26:39 -0700 Subject: Updated CHANGELOGS --- packages/sol-cov/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index ac53c9d7d..167d5077e 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -1,6 +1,6 @@ [ { - "timestamp": 1527009133, + "timestamp": 1527009134, "version": "0.0.11", "changes": [ { -- cgit v1.2.3 From 031f97e97c1fc303860339878b3f73d4ed30596e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:26:47 -0700 Subject: Publish - 0x.js@0.38.0 - @0xproject/abi-gen@0.3.0 - @0xproject/assert@0.2.10 - @0xproject/base-contract@0.3.2 - @0xproject/connect@0.6.13 - @0xproject/contract-wrappers@0.0.2 - contracts@2.1.29 - @0xproject/dev-utils@0.4.2 - @0xproject/fill-scenarios@0.0.2 - @0xproject/json-schemas@0.7.24 - @0xproject/metacoin@0.0.7 - @0xproject/migrations@0.0.6 - @0xproject/monorepo-scripts@0.1.20 - @0xproject/order-utils@0.0.5 - @0xproject/order-watcher@0.0.2 - @0xproject/react-docs-example@0.0.12 - @0xproject/react-docs@0.0.12 - @0xproject/react-shared@0.1.7 - @0xproject/sol-compiler@0.5.0 - @0xproject/sol-cov@0.0.11 - @0xproject/sol-resolver@0.0.5 - @0xproject/sra-report@0.1.0 - @0xproject/subproviders@0.10.2 - @0xproject/testnet-faucets@1.0.30 - @0xproject/tslint-config@0.4.18 - @0xproject/types@0.7.0 - @0xproject/typescript-typings@0.3.2 - @0xproject/utils@0.6.2 - @0xproject/web3-wrapper@0.6.4 - @0xproject/website@0.0.33 --- packages/0x.js/package.json | 34 ++++++++++++++++---------------- packages/abi-gen/package.json | 12 +++++------ packages/assert/package.json | 12 +++++------ packages/base-contract/package.json | 14 ++++++------- packages/connect/package.json | 16 +++++++-------- packages/contract-wrappers/package.json | 34 ++++++++++++++++---------------- packages/contracts/package.json | 22 ++++++++++----------- packages/dev-utils/package.json | 16 +++++++-------- packages/fill-scenarios/package.json | 22 ++++++++++----------- packages/json-schemas/package.json | 10 +++++----- packages/metacoin/package.json | 22 ++++++++++----------- packages/migrations/package.json | 20 +++++++++---------- packages/monorepo-scripts/package.json | 2 +- packages/order-utils/package.json | 20 +++++++++---------- packages/order-watcher/package.json | 34 ++++++++++++++++---------------- packages/react-docs-example/package.json | 6 +++--- packages/react-docs/package.json | 12 +++++------ packages/react-shared/package.json | 8 ++++---- packages/sol-compiler/package.json | 20 +++++++++---------- packages/sol-cov/package.json | 14 ++++++------- packages/sol-resolver/package.json | 8 ++++---- packages/sra-report/package.json | 18 ++++++++--------- packages/subproviders/package.json | 16 +++++++-------- packages/testnet-faucets/package.json | 14 ++++++------- packages/tslint-config/package.json | 4 ++-- packages/types/package.json | 6 +++--- packages/typescript-typings/package.json | 6 +++--- packages/utils/package.json | 10 +++++----- packages/web3-wrapper/package.json | 12 +++++------ packages/website/package.json | 16 +++++++-------- 30 files changed, 230 insertions(+), 230 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 7d9107bba..a498124b6 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -1,6 +1,6 @@ { "name": "0x.js", - "version": "0.37.2", + "version": "0.38.0", "engines": { "node": ">=6.12" }, @@ -66,12 +66,12 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/migrations": "^0.0.5", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/migrations": "^0.0.6", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -98,16 +98,16 @@ "webpack": "^3.1.0" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/contract-wrappers": "^0.0.1", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/order-watcher": "^0.0.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/contract-wrappers": "^0.0.2", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/order-watcher": "^0.0.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index ca666dc9b..d3af33fdf 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.2.13", + "version": "0.3.0", "engines": { "node": ">=6.12" }, @@ -27,9 +27,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -39,8 +39,8 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", diff --git a/packages/assert/package.json b/packages/assert/package.json index e3ac0d3ed..88f4dac99 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/assert", - "version": "0.2.9", + "version": "0.2.10", "engines": { "node": ">=6.12" }, @@ -30,8 +30,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -47,9 +47,9 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "lodash": "^4.17.4", "valid-url": "^1.0.9" }, diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index ca59dc4c8..f79d3ebf6 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/base-contract", - "version": "0.3.1", + "version": "0.3.2", "engines": { "node": ">=6.12" }, @@ -29,8 +29,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "chai": "^4.0.1", "copyfiles": "^1.2.0", @@ -42,10 +42,10 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/connect/package.json b/packages/connect/package.json index 65aa50a42..ed54b47ac 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "0.6.12", + "version": "0.6.13", "engines": { "node": ">=6.12" }, @@ -50,19 +50,19 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/assert": "^0.2.10", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", "query-string": "^5.0.1", "websocket": "^1.0.25" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/fetch-mock": "^5.12.1", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 6cb16c2c0..9dd6f097d 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/contract-wrappers", - "version": "0.0.1", + "version": "0.0.2", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -44,13 +44,13 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/migrations": "^0.0.5", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/migrations": "^0.0.6", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -76,15 +76,15 @@ "web3-provider-engine": "^14.0.4" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/fill-scenarios": "^0.0.1", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/fill-scenarios": "^0.0.2", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", "ethers": "^3.0.15", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 47d427967..0e8239e61 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "contracts", - "version": "2.1.28", + "version": "2.1.29", "engines": { "node": ">=6.12" }, @@ -42,9 +42,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/node": "^8.0.53", "@types/yargs": "^10.0.0", @@ -64,13 +64,13 @@ "yargs": "^10.0.3" }, "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "0x.js": "^0.38.0", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^5.1.1", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 49964c82a..96180b2ce 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/dev-utils", - "version": "0.4.1", + "version": "0.4.2", "engines": { "node": ">=6.12" }, @@ -29,8 +29,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", @@ -44,11 +44,11 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/sol-cov": "^0.0.10", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/sol-cov": "^0.0.11", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/web3-wrapper": "^0.6.4", "lodash": "^4.17.4", "web3": "^0.20.0", "web3-provider-engine": "^14.0.4" diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json index ee426c7a1..0d8ea6d13 100644 --- a/packages/fill-scenarios/package.json +++ b/packages/fill-scenarios/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/fill-scenarios", - "version": "0.0.1", + "version": "0.0.2", "description": "0x order fill scenario generator", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -23,10 +23,10 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -36,12 +36,12 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/base-contract": "^0.3.1", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index aece885ec..1612bbc0a 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/json-schemas", - "version": "0.7.23", + "version": "0.7.24", "engines": { "node": ">=6.12" }, @@ -45,15 +45,15 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { - "@0xproject/typescript-typings": "^0.3.1", + "@0xproject/typescript-typings": "^0.3.2", "@types/node": "^8.0.53", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/utils": "^0.6.1", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/utils": "^0.6.2", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 83d083b3f..312aa0819 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/metacoin", - "version": "0.0.6", + "version": "0.0.7", "engines": { "node": ">=6.12" }, @@ -26,21 +26,21 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/sol-cov": "^0.0.10", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/types": "^0.6.3", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/sol-cov": "^0.0.11", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/types": "^0.7.0", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4", "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", + "@0xproject/dev-utils": "^0.4.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^2.0.1", diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 16b61d121..49f4311f2 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/migrations", - "version": "0.0.5", + "version": "0.0.6", "engines": { "node": ">=6.12" }, @@ -24,10 +24,10 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/types": "^0.6.3", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/types": "^0.7.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", @@ -35,11 +35,11 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index 4fa9497b9..02a8e4a42 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/monorepo-scripts", - "version": "0.1.19", + "version": "0.1.20", "engines": { "node": ">=6.12" }, diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 63caaec34..117b57f45 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-utils", - "version": "0.0.4", + "version": "0.0.5", "engines": { "node": ">=6.12" }, @@ -43,9 +43,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -62,12 +62,12 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "@types/node": "^8.0.53", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index d65d3f175..2bd7e4dcb 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-watcher", - "version": "0.0.1", + "version": "0.0.2", "description": "An order watcher daemon that watches for order validity", "keywords": [ "0x", @@ -45,12 +45,12 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/migrations": "^0.0.5", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/migrations": "^0.0.6", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/tslint-config": "^0.4.18", "@types/bintrees": "^1.0.2", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -76,16 +76,16 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/contract-wrappers": "^0.0.1", - "@0xproject/fill-scenarios": "^0.0.1", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/contract-wrappers": "^0.0.2", + "@0xproject/fill-scenarios": "^0.0.2", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "bintrees": "^1.0.2", "ethers": "^3.0.15", "lodash": "^4.17.4" diff --git a/packages/react-docs-example/package.json b/packages/react-docs-example/package.json index 2cbf3ef73..a0538b933 100644 --- a/packages/react-docs-example/package.json +++ b/packages/react-docs-example/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0xproject/react-docs-example", - "version": "0.0.11", + "version": "0.0.12", "engines": { "node": ">=6.12" }, @@ -26,7 +26,7 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", @@ -50,7 +50,7 @@ "webpack-dev-server": "^2.11.1" }, "dependencies": { - "@0xproject/react-docs": "^0.0.11", + "@0xproject/react-docs": "^0.0.12", "basscss": "^8.0.3", "lodash": "^4.17.4", "material-ui": "^0.17.1", diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index 9245cfb1e..531c0d90c 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-docs", - "version": "0.0.11", + "version": "0.0.12", "engines": { "node": ">=6.12" }, @@ -25,9 +25,9 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -35,8 +35,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/react-shared": "^0.1.6", - "@0xproject/utils": "^0.6.1", + "@0xproject/react-shared": "^0.1.7", + "@0xproject/utils": "^0.6.2", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index af0920d27..d28972325 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-shared", - "version": "0.1.6", + "version": "0.1.7", "engines": { "node": ">=6.12" }, @@ -25,9 +25,9 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 31a10f8b7..c94e59eb4 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-compiler", - "version": "0.4.3", + "version": "0.5.0", "engines": { "node": ">=6.12" }, @@ -49,9 +49,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/mkdirp": "^0.5.2", "@types/require-from-string": "^1.2.0", "@types/semver": "^5.5.0", @@ -72,12 +72,12 @@ "zeppelin-solidity": "1.8.0" }, "dependencies": { - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/sol-resolver": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/sol-resolver": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "@types/yargs": "^11.0.0", "chalk": "^2.3.0", "ethereumjs-util": "^5.1.1", diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 28ceae0fa..f3c8ab67e 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-cov", - "version": "0.0.10", + "version": "0.0.11", "engines": { "node": ">=6.12" }, @@ -46,10 +46,10 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { - "@0xproject/subproviders": "^0.10.1", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "ethereumjs-util": "^5.1.1", "glob": "^7.1.2", "istanbul": "^0.4.5", @@ -59,8 +59,8 @@ "solidity-parser-antlr": "^0.2.8" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/istanbul": "^0.4.30", "@types/mkdirp": "^0.5.1", "@types/mocha": "^2.2.42", diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index 54d8308de..64a0f19ab 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-resolver", - "version": "0.0.4", + "version": "0.0.5", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -33,7 +33,7 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", + "@0xproject/types": "^0.7.0", "@0xproject/typescript-typings": "^0.0.3", "lodash": "^4.17.4" }, diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 9622acd2e..0ab83f5f7 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sra-report", - "version": "0.0.14", + "version": "0.1.0", "engines": { "node": ">=6.12" }, @@ -31,20 +31,20 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-report/README.md", "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/assert": "^0.2.9", - "@0xproject/connect": "^0.6.12", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "0x.js": "^0.38.0", + "@0xproject/assert": "^0.2.10", + "@0xproject/connect": "^0.6.13", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "chalk": "^2.3.0", "lodash": "^4.17.4", "newman": "^3.9.3", "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.48", "@types/nock": "^9.1.2", diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 21e47b85a..3cd5f0e9b 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/subproviders", - "version": "0.10.1", + "version": "0.10.2", "engines": { "node": ">=6.12" }, @@ -39,10 +39,10 @@ } }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/assert": "^0.2.10", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "@ledgerhq/hw-app-eth": "^4.3.0", "@ledgerhq/hw-transport-u2f": "^4.3.0", "bip39": "^2.5.0", @@ -57,9 +57,9 @@ "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/utils": "^0.6.1", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/utils": "^0.6.2", "@types/bip39": "^2.4.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index db5fe75c7..c565d5b7d 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0xproject/testnet-faucets", - "version": "1.0.29", + "version": "1.0.30", "engines": { "node": ">=6.12" }, @@ -18,11 +18,11 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "0x.js": "^0.38.0", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "body-parser": "^1.17.1", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", @@ -33,7 +33,7 @@ "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/tslint-config": "^0.4.18", "@types/body-parser": "^1.16.1", "@types/express": "^4.0.35", "@types/lodash": "4.14.104", diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 75cf03b05..fae03fe0e 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/tslint-config", - "version": "0.4.17", + "version": "0.4.18", "engines": { "node": ">=6.12" }, @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/tslint-config/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", + "@0xproject/monorepo-scripts": "^0.1.20", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", diff --git a/packages/types/package.json b/packages/types/package.json index edd17c42c..0968c6b7a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/types", - "version": "0.6.3", + "version": "0.7.0", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index 986acfcee..932f89ec5 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/typescript-typings", - "version": "0.3.1", + "version": "0.3.2", "engines": { "node": ">=6.12" }, @@ -25,11 +25,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", "dependencies": { - "@0xproject/types": "^0.6.3", + "@0xproject/types": "^0.7.0", "bignumber.js": "~4.1.0" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", + "@0xproject/monorepo-scripts": "^0.1.20", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2" diff --git a/packages/utils/package.json b/packages/utils/package.json index 66dc682fa..99d3d9256 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "0.6.1", + "version": "0.6.2", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -35,8 +35,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", "@types/node": "^8.0.53", "bignumber.js": "~4.1.0", "ethers": "^3.0.15", diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index ed2fce7dc..18bbf14a0 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/web3-wrapper", - "version": "0.6.3", + "version": "0.6.4", "engines": { "node": ">=6.12" }, @@ -43,8 +43,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -62,9 +62,9 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "ethers": "^3.0.15", "lodash": "^4.17.4", "web3": "^0.20.0" diff --git a/packages/website/package.json b/packages/website/package.json index 3ef66d269..a27dd8b79 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/website", - "version": "0.0.32", + "version": "0.0.33", "engines": { "node": ">=6.12" }, @@ -18,13 +18,13 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/react-docs": "^0.0.11", - "@0xproject/react-shared": "^0.1.6", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "0x.js": "^0.38.0", + "@0xproject/react-docs": "^0.0.12", + "@0xproject/react-shared": "^0.1.7", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "accounting": "^0.4.1", "basscss": "^8.0.3", "blockies": "^0.0.2", -- cgit v1.2.3 From 187fa71526148bbfb7a16229ef88c5d7726a2e0d Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 22 May 2018 10:53:46 -0700 Subject: Remove extra awaitTransactionMinedAsync calls --- packages/contracts/test/multi_sig_with_time_lock.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index e467df0d7..8e7589afd 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -127,7 +127,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); + const subRes = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -139,8 +139,7 @@ describe('MultiSigWalletWithTimeLock', () => { expect(initialSecondsTimeLocked).to.be.equal(0); txHash = await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }); - await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(res.logs).to.have.length(2); const secondsTimeLocked = new BigNumber(await multiSig.secondsTimeLocked.callAsync()); @@ -183,7 +182,6 @@ describe('MultiSigWalletWithTimeLock', () => { txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1], }); - await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const confRes = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); expect(confRes.logs).to.have.length(2); }); -- cgit v1.2.3 From e26c0c58aeb435e4fbec1b111b77d51b67dacdbe Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 22 May 2018 11:02:29 -0700 Subject: Rename some variables in multi_sig_with_time_lock.ts --- packages/contracts/test/multi_sig_with_time_lock.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index 8e7589afd..3f61005e7 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -80,8 +80,8 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; const txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); - const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< + const txReceipt = await zeroEx.awaitTransactionMinedAsync(txHash); + const log = abiDecoder.tryToDecodeLogOrNoop(txReceipt.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -100,8 +100,8 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); - const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< + const txReceipt = await zeroEx.awaitTransactionMinedAsync(txHash); + const log = abiDecoder.tryToDecodeLogOrNoop(txReceipt.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -127,8 +127,8 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); - const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< + const txReceipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const log = abiDecoder.tryToDecodeLogOrNoop(txReceipt.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -174,16 +174,16 @@ describe('MultiSigWalletWithTimeLock', () => { args: [newSecondsTimeLocked], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); - const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< + let txReceipt = await zeroEx.awaitTransactionMinedAsync(txHash); + const log = abiDecoder.tryToDecodeLogOrNoop(txReceipt.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; txId = log.args.transactionId; txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1], }); - const confRes = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); - expect(confRes.logs).to.have.length(2); + txReceipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + expect(txReceipt.logs).to.have.length(2); }); const newSecondsTimeLocked = 0; it('should throw if it has enough confirmations but is not past the time lock', async () => { -- cgit v1.2.3 From a682b5d90e4c651e4e5d5d7c700237a9b6fe22bf Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:18:50 -0700 Subject: Remove 0x.js dep from contracts --- packages/contracts/package.json | 6 +- packages/contracts/src/utils/address_utils.ts | 4 +- packages/contracts/src/utils/constants.ts | 15 +- packages/contracts/src/utils/erc721_wrapper.ts | 4 +- packages/contracts/src/utils/exchange_wrapper.ts | 11 +- packages/contracts/src/utils/order_factory.ts | 9 +- .../contracts/src/utils/transaction_factory.ts | 4 +- packages/contracts/test/asset_proxy/proxies.ts | 11 +- packages/contracts/test/ether_token.ts | 7 +- packages/contracts/test/exchange/core.ts | 51 +++---- packages/contracts/test/exchange/dispatcher.ts | 29 ++-- packages/contracts/test/exchange/libs.ts | 2 - packages/contracts/test/exchange/match_orders.ts | 163 ++++++++++----------- .../contracts/test/exchange/signature_validator.ts | 2 - packages/contracts/test/exchange/transactions.ts | 12 +- packages/contracts/test/exchange/wrapper.ts | 37 ++--- packages/contracts/test/libraries/lib_bytes.ts | 2 +- .../contracts/test/multi_sig_with_time_lock.ts | 17 +-- packages/contracts/test/token_registry.ts | 3 +- packages/contracts/test/tutorials/arbitrage.ts | 4 +- .../contracts/test/unlimited_allowance_token.ts | 50 +++---- .../contracts/test/utils/match_order_tester.ts | 2 +- packages/contracts/test/zrx_token.ts | 56 +++---- packages/tslint-config/package.json | 2 +- yarn.lock | 117 +++++++++++++++ 25 files changed, 353 insertions(+), 267 deletions(-) diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 9c7142cdb..b19f0cd50 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -28,8 +28,7 @@ "test:circleci": "yarn test:coverage" }, "config": { - "abis": - "../migrations/artifacts/2.0.0/@(DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TestAssetProxyDispatcher|TestLibBytes|TestLibs|TestSignatureValidator|TokenRegistry|WETH9|ZRXToken).json" + "abis": "../migrations/artifacts/2.0.0/@(DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TestAssetProxyDispatcher|TestLibBytes|TestLibs|TestSignatureValidator|TokenRegistry|WETH9|ZRXToken).json" }, "repository": { "type": "git", @@ -64,8 +63,9 @@ "yargs": "^10.0.3" }, "dependencies": { - "0x.js": "^0.37.2", "@0xproject/base-contract": "^0.3.1", + "@0xproject/contract-wrappers": "^0.0.2", + "@0xproject/order-utils": "^0.0.4", "@0xproject/sol-compiler": "^0.4.3", "@0xproject/types": "^0.6.3", "@0xproject/typescript-typings": "^0.3.1", diff --git a/packages/contracts/src/utils/address_utils.ts b/packages/contracts/src/utils/address_utils.ts index 01a7a6fd4..dc63459f9 100644 --- a/packages/contracts/src/utils/address_utils.ts +++ b/packages/contracts/src/utils/address_utils.ts @@ -1,10 +1,10 @@ -import { ZeroEx } from '0x.js'; +import { generatePseudoRandomSalt } from '@0xproject/order-utils'; import { crypto } from './crypto'; export const addressUtils = { generatePseudoRandomAddress(): string { - const randomBigNum = ZeroEx.generatePseudoRandomSalt(); + const randomBigNum = generatePseudoRandomSalt(); const randomBuff = crypto.solSHA3([randomBigNum]); const randomAddress = `0x${randomBuff.slice(0, 20).toString('hex')}`; return randomAddress; diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts index 3fd2a0a3b..e45e51c04 100644 --- a/packages/contracts/src/utils/constants.ts +++ b/packages/contracts/src/utils/constants.ts @@ -1,5 +1,5 @@ -import { ZeroEx } from '0x.js'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3_wrapper'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; @@ -30,13 +30,14 @@ export const constants = { NUM_DUMMY_ERC20_TO_DEPLOY: 3, NUM_DUMMY_ERC721_TO_DEPLOY: 1, NUM_ERC721_TOKENS_TO_MINT: 2, + NULL_ADDRESS: '0x0000000000000000000000000000000000000000', TESTRPC_PRIVATE_KEYS: _.map(TESTRPC_PRIVATE_KEYS_STRINGS, privateKeyString => ethUtil.toBuffer(privateKeyString)), - INITIAL_ERC20_BALANCE: ZeroEx.toBaseUnitAmount(new BigNumber(10000), 18), - INITIAL_ERC20_ALLOWANCE: ZeroEx.toBaseUnitAmount(new BigNumber(10000), 18), + INITIAL_ERC20_BALANCE: Web3Wrapper.toBaseUnitAmount(new BigNumber(10000), 18), + INITIAL_ERC20_ALLOWANCE: Web3Wrapper.toBaseUnitAmount(new BigNumber(10000), 18), STATIC_ORDER_PARAMS: { - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), - makerFee: ZeroEx.toBaseUnitAmount(new BigNumber(1), 18), - takerFee: ZeroEx.toBaseUnitAmount(new BigNumber(1), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), + makerFee: Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18), + takerFee: Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18), }, }; diff --git a/packages/contracts/src/utils/erc721_wrapper.ts b/packages/contracts/src/utils/erc721_wrapper.ts index 5b5de262f..bf8953a49 100644 --- a/packages/contracts/src/utils/erc721_wrapper.ts +++ b/packages/contracts/src/utils/erc721_wrapper.ts @@ -1,4 +1,4 @@ -import { ZeroEx } from '0x.js'; +import { generatePseudoRandomSalt } from '@0xproject/order-utils'; import { Provider } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; @@ -54,7 +54,7 @@ export class ERC721Wrapper { _.forEach(this._dummyTokenContracts, dummyTokenContract => { _.forEach(this._tokenOwnerAddresses, tokenOwnerAddress => { _.forEach(_.range(constants.NUM_ERC721_TOKENS_TO_MINT), () => { - const tokenId = ZeroEx.generatePseudoRandomSalt(); + const tokenId = generatePseudoRandomSalt(); setBalancePromises.push( dummyTokenContract.mint.sendTransactionAsync(tokenOwnerAddress, tokenId, { from: this._contractOwnerAddress, diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index 46531fa3f..98d5e27f9 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -1,5 +1,6 @@ -import { TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js'; +import { TransactionReceiptWithDecodedLogs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -14,10 +15,8 @@ import { AssetProxyId, OrderInfo, SignedOrder, SignedTransaction } from './types export class ExchangeWrapper { private _exchange: ExchangeContract; private _logDecoder: LogDecoder = new LogDecoder(constants.TESTRPC_NETWORK_ID); - private _zeroEx: ZeroEx; - constructor(exchangeContract: ExchangeContract, zeroEx: ZeroEx) { + constructor(exchangeContract: ExchangeContract) { this._exchange = exchangeContract; - this._zeroEx = zeroEx; } public async fillOrderAsync( signedOrder: SignedOrder, @@ -196,7 +195,7 @@ export class ExchangeWrapper { opts: { oldAssetProxyAddressIfExists?: string } = {}, ): Promise { const oldAssetProxyAddress = _.isUndefined(opts.oldAssetProxyAddressIfExists) - ? ZeroEx.NULL_ADDRESS + ? constants.NULL_ADDRESS : opts.oldAssetProxyAddressIfExists; const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync( assetProxyId, @@ -246,7 +245,7 @@ export class ExchangeWrapper { return tx; } private async _getTxWithDecodedExchangeLogsAsync(txHash: string) { - const tx = await this._zeroEx.awaitTransactionMinedAsync(txHash); + const tx = await Web3Wrapper.awaitTransactionMinedAsync(txHash); tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address); tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log)); return tx; diff --git a/packages/contracts/src/utils/order_factory.ts b/packages/contracts/src/utils/order_factory.ts index 044e9b865..86b3d5ac7 100644 --- a/packages/contracts/src/utils/order_factory.ts +++ b/packages/contracts/src/utils/order_factory.ts @@ -1,7 +1,8 @@ -import { ZeroEx } from '0x.js'; +import { generatePseudoRandomSalt } from '@0xproject/order-utils'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; +import { constants } from './constants'; import { orderUtils } from './order_utils'; import { signingUtils } from './signing_utils'; import { SignatureType, SignedOrder, UnsignedOrder } from './types'; @@ -19,10 +20,10 @@ export class OrderFactory { ): SignedOrder { const randomExpiration = new BigNumber(Math.floor((Date.now() + Math.random() * 100000000000) / 1000)); const order = ({ - senderAddress: ZeroEx.NULL_ADDRESS, + senderAddress: constants.NULL_ADDRESS, expirationTimeSeconds: randomExpiration, - salt: ZeroEx.generatePseudoRandomSalt(), - takerAddress: ZeroEx.NULL_ADDRESS, + salt: generatePseudoRandomSalt(), + takerAddress: constants.NULL_ADDRESS, ...this._defaultOrderParams, ...customOrderParams, } as any) as UnsignedOrder; diff --git a/packages/contracts/src/utils/transaction_factory.ts b/packages/contracts/src/utils/transaction_factory.ts index 3a4f48330..941bff96d 100644 --- a/packages/contracts/src/utils/transaction_factory.ts +++ b/packages/contracts/src/utils/transaction_factory.ts @@ -1,4 +1,4 @@ -import { ZeroEx } from '0x.js'; +import { generatePseudoRandomSalt } from '@0xproject/order-utils'; import { BigNumber } from '@0xproject/utils'; import * as ethUtil from 'ethereumjs-util'; @@ -20,7 +20,7 @@ export class TransactionFactory { data: string, signatureType: SignatureType = SignatureType.Ecrecover, ): SignedTransaction { - const salt = ZeroEx.generatePseudoRandomSalt(); + const salt = generatePseudoRandomSalt(); const txHash = crypto.solSHA3([this._exchangeAddress, salt, ethUtil.toBuffer(data)]); const signature = signingUtils.signMessage(txHash, this._privateKey, signatureType); const signedTx = { diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index e7ef9a0d3..3c72968d3 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -37,8 +36,6 @@ describe('Asset Transfer Proxies', () => { let erc721Wrapper: ERC721Wrapper; let erc721MakerTokenId: BigNumber; - let zeroEx: ZeroEx; - before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, notAuthorized, exchangeAddress, makerAddress, takerAddress] = accounts); @@ -61,10 +58,6 @@ describe('Asset Transfer Proxies', () => { await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeAddress, { from: owner, }); - - zeroEx = new ZeroEx(provider, { - networkId: constants.TESTRPC_NETWORK_ID, - }); }); beforeEach(async () => { await blockchainLifecycle.startAsync(); @@ -179,7 +172,7 @@ describe('Asset Transfer Proxies', () => { amounts, { from: exchangeAddress }, ); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await web3Wrapper.awaitTransactionMinedAsync(txHash); const newBalances = await erc20Wrapper.getBalancesAsync(); expect(res.logs.length).to.equal(numTransfers); @@ -356,7 +349,7 @@ describe('Asset Transfer Proxies', () => { amounts, { from: exchangeAddress }, ); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await web3Wrapper.awaitTransactionMinedAsync(txHash); expect(res.logs.length).to.equal(numTransfers); const newOwnerMakerAssetA = await erc721Token.ownerOf.callAsync(makerTokenIdA); diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 418fbc45e..a71d96cb8 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -1,7 +1,8 @@ -import { ContractWrappersError, ZeroEx } from '0x.js'; +import { ContractWrappersError } from '@0xproject/contract-wrappers'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber, promisify } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { Web3Wrapper } from '@0xproject/web3_wrapper'; import * as chai from 'chai'; import 'make-promises-safe'; @@ -17,7 +18,7 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('EtherToken', () => { let account: string; - const gasPrice = ZeroEx.toBaseUnitAmount(new BigNumber(20), 9); + const gasPrice = Web3Wrapper.toBaseUnitAmount(new BigNumber(20), 9); let zeroEx: ZeroEx; let etherTokenAddress: string; before(async () => { @@ -103,7 +104,7 @@ describe('EtherToken', () => { const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); const initEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); - const ethToDeposit = ZeroEx.toBaseUnitAmount(new BigNumber(1), 18); + const ethToDeposit = Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18); const txHash = await web3Wrapper.sendTransactionAsync({ from: account, diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index be3252800..a8a402555 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -1,6 +1,7 @@ -import { LogWithDecodedArgs, ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import { LogWithDecodedArgs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web-wrapper'; import * as chai from 'chai'; import ethUtil = require('ethereumjs-util'); import 'make-promises-safe'; @@ -89,7 +90,7 @@ describe('Exchange core', () => { exchangeContractAddress: exchange.address, networkId: constants.TESTRPC_NETWORK_ID, }); - exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); + exchangeWrapper = new ExchangeWrapper(exchange); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); @@ -166,8 +167,8 @@ describe('Exchange core', () => { it('should transfer the correct amounts when makerAssetAmount === takerAssetAmount', async () => { signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), }); const takerAssetFilledAmountBefore = await exchangeWrapper.getTakerAssetFilledAmountAsync( @@ -219,8 +220,8 @@ describe('Exchange core', () => { it('should transfer the correct amounts when makerAssetAmount > takerAssetAmount', async () => { signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), }); const takerAssetFilledAmountBefore = await exchangeWrapper.getTakerAssetFilledAmountAsync( @@ -272,8 +273,8 @@ describe('Exchange core', () => { it('should transfer the correct amounts when makerAssetAmount < takerAssetAmount', async () => { signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), }); const takerAssetFilledAmountBefore = await exchangeWrapper.getTakerAssetFilledAmountAsync( @@ -326,8 +327,8 @@ describe('Exchange core', () => { it('should transfer the correct amounts when taker is specified and order is claimed by taker', async () => { signedOrder = orderFactory.newSignedOrder({ takerAddress, - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), }); const takerAssetFilledAmountBefore = await exchangeWrapper.getTakerAssetFilledAmountAsync( @@ -445,8 +446,8 @@ describe('Exchange core', () => { it('should throw when taker is specified and order is claimed by other', async () => { signedOrder = orderFactory.newSignedOrder({ takerAddress: feeRecipientAddress, - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), }); return expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( constants.REVERT, @@ -455,7 +456,7 @@ describe('Exchange core', () => { it('should throw if signature is invalid', async () => { signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), }); const invalidR = ethUtil.sha3('invalidR'); @@ -501,7 +502,7 @@ describe('Exchange core', () => { it('should throw if maker erc20Balances are too low to fill order', async () => { signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18), }); return expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( @@ -511,7 +512,7 @@ describe('Exchange core', () => { it('should throw if taker erc20Balances are too low to fill order', async () => { signedOrder = orderFactory.newSignedOrder({ - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18), }); return expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( @@ -681,23 +682,23 @@ describe('Exchange core', () => { erc20Balances = await erc20Wrapper.getBalancesAsync(); const signedOrders = await Promise.all([ orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(9), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(9), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(9), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(9), 18), salt: new BigNumber(0), }), orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(79), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(79), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(79), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(79), 18), salt: new BigNumber(1), }), orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(979), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(979), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(979), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(979), 18), salt: new BigNumber(2), }), orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(7979), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(7979), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(7979), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(7979), 18), salt: new BigNumber(3), }), ]); @@ -873,7 +874,7 @@ describe('Exchange core', () => { const makerAssetId = erc721MakerAssetIds[0]; signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultTakerAssetAddress), }); @@ -913,7 +914,7 @@ describe('Exchange core', () => { const takerAssetId = erc721TakerAssetIds[0]; signedOrder = orderFactory.newSignedOrder({ takerAssetAmount: new BigNumber(1), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultMakerAssetAddress), }); diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index db2f18ddc..3a09eb122 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -71,7 +70,7 @@ describe('AssetProxyDispatcher', () => { }); describe('registerAssetProxy', () => { it('should record proxy upon registration', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, @@ -84,7 +83,7 @@ describe('AssetProxyDispatcher', () => { it('should be able to record multiple proxies', async () => { // Record first proxy - const prevERC20ProxyAddress = ZeroEx.NULL_ADDRESS; + const prevERC20ProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, @@ -94,7 +93,7 @@ describe('AssetProxyDispatcher', () => { let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); // Record another proxy - const prevERC721ProxyAddress = ZeroEx.NULL_ADDRESS; + const prevERC721ProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, erc721Proxy.address, @@ -107,7 +106,7 @@ describe('AssetProxyDispatcher', () => { it('should replace proxy address upon re-registration', async () => { // Initial registration - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, @@ -138,7 +137,7 @@ describe('AssetProxyDispatcher', () => { it('should throw if registering with incorrect "currentAssetProxyAddress" field', async () => { // Initial registration - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, @@ -147,12 +146,12 @@ describe('AssetProxyDispatcher', () => { ); const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); - // The following transaction will throw because the currentAddress is no longer ZeroEx.NULL_ADDRESS + // The following transaction will throw because the currentAddress is no longer constants.NULL_ADDRESS return expect( assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, - ZeroEx.NULL_ADDRESS, + constants.NULL_ADDRESS, { from: owner }, ), ).to.be.rejectedWith(constants.REVERT); @@ -160,7 +159,7 @@ describe('AssetProxyDispatcher', () => { it('should be able to reset proxy address to NULL', async () => { // Initial registration - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, @@ -170,7 +169,7 @@ describe('AssetProxyDispatcher', () => { const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); // The following transaction will reset the proxy address - const newProxyAddress = ZeroEx.NULL_ADDRESS; + const newProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, newProxyAddress, @@ -182,7 +181,7 @@ describe('AssetProxyDispatcher', () => { }); it('should throw if requesting address is not owner', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; return expect( assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -194,7 +193,7 @@ describe('AssetProxyDispatcher', () => { }); it('should throw if attempting to register a proxy to the incorrect id', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; return expect( assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, @@ -208,7 +207,7 @@ describe('AssetProxyDispatcher', () => { describe('getAssetProxy', () => { it('should return correct address of registered proxy', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, @@ -221,14 +220,14 @@ describe('AssetProxyDispatcher', () => { it('should return NULL address if requesting non-existent proxy', async () => { const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); - expect(proxyAddress).to.be.equal(ZeroEx.NULL_ADDRESS); + expect(proxyAddress).to.be.equal(constants.NULL_ADDRESS); }); }); describe('dispatchTransferFrom', () => { it('should dispatch transfer to registered proxy', async () => { // Register ERC20 proxy - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts index 1036cb815..9af5916dd 100644 --- a/packages/contracts/test/exchange/libs.ts +++ b/packages/contracts/test/exchange/libs.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -29,7 +28,6 @@ describe('Exchange libs', () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const makerAddress = accounts[0]; libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults); - const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID }); const defaultOrderParams = { ...constants.STATIC_ORDER_PARAMS, diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index 94cdf4598..bdf4f54fb 100644 --- a/packages/contracts/test/exchange/match_orders.ts +++ b/packages/contracts/test/exchange/match_orders.ts @@ -1,6 +1,7 @@ -import { LogWithDecodedArgs, ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import { LogWithDecodedArgs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; @@ -76,8 +77,6 @@ describe('matchOrders', () => { let matchOrderTester: MatchOrderTester; - let zeroEx: ZeroEx; - before(async () => { // Create accounts const accounts = await web3Wrapper.getAvailableAddressesAsync(); @@ -111,11 +110,7 @@ describe('matchOrders', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - zeroEx = new ZeroEx(provider, { - exchangeContractAddress: exchange.address, - networkId: constants.TESTRPC_NETWORK_ID, - }); - exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); + exchangeWrapper = new ExchangeWrapper(exchange); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); // Authorize ERC20 and ERC721 trades by exchange @@ -161,16 +156,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match signedOrderLeft with signedOrderRight @@ -195,16 +190,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Store original taker balance @@ -240,16 +235,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(20), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(4), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(20), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(4), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -274,16 +269,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(50), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -308,16 +303,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(50), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -347,8 +342,8 @@ describe('matchOrders', () => { makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(50), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match signedOrderLeft with signedOrderRight2 @@ -377,8 +372,8 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressLeft, }); @@ -386,8 +381,8 @@ describe('matchOrders', () => { makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(50), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -417,8 +412,8 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(50), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), feeRecipientAddress: feeRecipientAddressLeft, }); // Match signedOrderLeft2 with signedOrderRight @@ -450,16 +445,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress, }); // Match orders @@ -478,16 +473,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -507,16 +502,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -536,16 +531,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -565,16 +560,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -594,16 +589,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: makerAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: makerAddressRight, }); // Match orders @@ -622,16 +617,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Cancel left order @@ -648,16 +643,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Cancel right order @@ -674,16 +669,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(1), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -704,16 +699,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -734,16 +729,16 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(5), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(2), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders @@ -766,14 +761,14 @@ describe('matchOrders', () => { makerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), makerAssetAmount: new BigNumber(1), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: new BigNumber(1), feeRecipientAddress: feeRecipientAddressRight, }); @@ -800,7 +795,7 @@ describe('matchOrders', () => { makerAddress: makerAddressLeft, makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), takerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: new BigNumber(1), feeRecipientAddress: feeRecipientAddressLeft, }); @@ -809,7 +804,7 @@ describe('matchOrders', () => { makerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), makerAssetAmount: new BigNumber(1), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(10), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressRight, }); // Match orders diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index 489ed32c5..7dac28c17 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -33,7 +32,6 @@ describe('MixinSignatureValidator', () => { provider, txDefaults, ); - const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID }); const defaultOrderParams = { ...constants.STATIC_ORDER_PARAMS, diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index 482475554..cd18b60ed 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -1,5 +1,3 @@ -import { ZeroEx } from '0x.js'; - import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -59,8 +57,6 @@ describe('Exchange transactions', () => { let defaultMakerTokenAddress: string; let defaultTakerTokenAddress: string; - let zeroEx: ZeroEx; - before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, senderAddress, makerAddress, takerAddress, feeRecipientAddress] = accounts); @@ -77,11 +73,7 @@ describe('Exchange transactions', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - zeroEx = new ZeroEx(provider, { - exchangeContractAddress: exchange.address, - networkId: constants.TESTRPC_NETWORK_ID, - }); - exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); + exchangeWrapper = new ExchangeWrapper(exchange); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }); @@ -179,7 +171,7 @@ describe('Exchange transactions', () => { it('should reset the currentContextAddress', async () => { await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress); const currentContextAddress = await exchange.currentContextAddress.callAsync(); - expect(currentContextAddress).to.equal(ZeroEx.NULL_ADDRESS); + expect(currentContextAddress).to.equal(constants.NULL_ADDRESS); }); }); diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 0b79308dd..4ff530874 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -54,8 +53,6 @@ describe('Exchange wrappers', () => { let defaultMakerAssetAddress: string; let defaultTakerAssetAddress: string; - let zeroEx: ZeroEx; - before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, makerAddress, takerAddress, feeRecipientAddress] = accounts); @@ -80,11 +77,7 @@ describe('Exchange wrappers', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - zeroEx = new ZeroEx(provider, { - exchangeContractAddress: exchange.address, - networkId: constants.TESTRPC_NETWORK_ID, - }); - exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); + exchangeWrapper = new ExchangeWrapper(exchange); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); @@ -119,8 +112,8 @@ describe('Exchange wrappers', () => { describe('fillOrKillOrder', () => { it('should transfer the correct amounts', async () => { const signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), }); const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); await exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress, { @@ -187,8 +180,8 @@ describe('Exchange wrappers', () => { describe('fillOrderNoThrow', () => { it('should transfer the correct amounts', async () => { const signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), }); const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress, { @@ -231,7 +224,7 @@ describe('Exchange wrappers', () => { it('should not change erc20Balances if maker erc20Balances are too low to fill order', async () => { const signedOrder = orderFactory.newSignedOrder({ - makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18), + makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18), }); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); @@ -241,7 +234,7 @@ describe('Exchange wrappers', () => { it('should not change erc20Balances if taker erc20Balances are too low to fill order', async () => { const signedOrder = orderFactory.newSignedOrder({ - takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18), + takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18), }); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); @@ -620,7 +613,7 @@ describe('Exchange wrappers', () => { }); it('should fill all signedOrders if cannot fill entire takerAssetFillAmount', async () => { - const takerAssetFillAmount = ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18); + const takerAssetFillAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18); _.forEach(signedOrders, signedOrder => { erc20Balances[makerAddress][defaultMakerAssetAddress] = erc20Balances[makerAddress][ defaultMakerAssetAddress @@ -663,7 +656,7 @@ describe('Exchange wrappers', () => { return expect( exchangeWrapper.marketSellOrdersAsync(signedOrders, takerAddress, { - takerAssetFillAmount: ZeroEx.toBaseUnitAmount(new BigNumber(1000), 18), + takerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18), }), ).to.be.rejectedWith(constants.REVERT); }); @@ -709,7 +702,7 @@ describe('Exchange wrappers', () => { }); it('should fill all signedOrders if cannot fill entire takerAssetFillAmount', async () => { - const takerAssetFillAmount = ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18); + const takerAssetFillAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18); _.forEach(signedOrders, signedOrder => { erc20Balances[makerAddress][defaultMakerAssetAddress] = erc20Balances[makerAddress][ defaultMakerAssetAddress @@ -752,7 +745,7 @@ describe('Exchange wrappers', () => { return expect( exchangeWrapper.marketSellOrdersNoThrowAsync(signedOrders, takerAddress, { - takerAssetFillAmount: ZeroEx.toBaseUnitAmount(new BigNumber(1000), 18), + takerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18), }), ).to.be.rejectedWith(constants.REVERT); }); @@ -798,7 +791,7 @@ describe('Exchange wrappers', () => { }); it('should fill all signedOrders if cannot fill entire makerAssetFillAmount', async () => { - const makerAssetFillAmount = ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18); + const makerAssetFillAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18); _.forEach(signedOrders, signedOrder => { erc20Balances[makerAddress][defaultMakerAssetAddress] = erc20Balances[makerAddress][ defaultMakerAssetAddress @@ -841,7 +834,7 @@ describe('Exchange wrappers', () => { return expect( exchangeWrapper.marketBuyOrdersAsync(signedOrders, takerAddress, { - makerAssetFillAmount: ZeroEx.toBaseUnitAmount(new BigNumber(1000), 18), + makerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18), }), ).to.be.rejectedWith(constants.REVERT); }); @@ -887,7 +880,7 @@ describe('Exchange wrappers', () => { }); it('should fill all signedOrders if cannot fill entire takerAssetFillAmount', async () => { - const takerAssetFillAmount = ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18); + const takerAssetFillAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18); _.forEach(signedOrders, signedOrder => { erc20Balances[makerAddress][defaultMakerAssetAddress] = erc20Balances[makerAddress][ defaultMakerAssetAddress @@ -930,7 +923,7 @@ describe('Exchange wrappers', () => { return expect( exchangeWrapper.marketBuyOrdersNoThrowAsync(signedOrders, takerAddress, { - makerAssetFillAmount: ZeroEx.toBaseUnitAmount(new BigNumber(1000), 18), + makerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18), }), ).to.be.rejectedWith(constants.REVERT); }); diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index 5ed5c356f..d0e553939 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -1,5 +1,5 @@ -import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import BN = require('bn.js'); diff --git a/packages/contracts/test/multi_sig_with_time_lock.ts b/packages/contracts/test/multi_sig_with_time_lock.ts index 8e58006ac..771bae8af 100644 --- a/packages/contracts/test/multi_sig_with_time_lock.ts +++ b/packages/contracts/test/multi_sig_with_time_lock.ts @@ -1,5 +1,5 @@ -import { LogWithDecodedArgs, ZeroEx } from '0x.js'; import { BlockchainLifecycle, web3Factory } from '@0xproject/dev-utils'; +import { LogWithDecodedArgs } from '@0xproject/types'; import { AbiDecoder, BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; @@ -20,7 +20,6 @@ const MULTI_SIG_ABI = artifacts.MultiSigWalletWithTimeLock.compilerOutput.abi; chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); -const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID }); const abiDecoder = new AbiDecoder([MULTI_SIG_ABI]); describe('MultiSigWalletWithTimeLock', () => { @@ -74,7 +73,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; const txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); + const subRes = await web3Wrapper.awaitTransactionMinedAsync(txHash); const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -94,14 +93,14 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); + const subRes = await web3Wrapper.awaitTransactionMinedAsync(txHash); const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; txId = log.args.transactionId; txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1] }); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await web3Wrapper.awaitTransactionMinedAsync(txHash); expect(res.logs).to.have.length(2); const blockNum = await web3Wrapper.getBlockNumberAsync(); @@ -121,7 +120,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [SECONDS_TIME_LOCKED.toNumber()], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); + const subRes = await web3Wrapper.awaitTransactionMinedAsync(txHash); const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -132,7 +131,7 @@ describe('MultiSigWalletWithTimeLock', () => { expect(initialSecondsTimeLocked).to.be.equal(0); txHash = await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] }); - const res = await zeroEx.awaitTransactionMinedAsync(txHash); + const res = await web3Wrapper.awaitTransactionMinedAsync(txHash); expect(res.logs).to.have.length(2); const secondsTimeLocked = new BigNumber(await multiSig.secondsTimeLocked.callAsync()); @@ -161,7 +160,7 @@ describe('MultiSigWalletWithTimeLock', () => { args: [newSecondsTimeLocked], }; let txHash = await multiSigWrapper.submitTransactionAsync(destination, from, dataParams); - const subRes = await zeroEx.awaitTransactionMinedAsync(txHash); + const subRes = await web3Wrapper.awaitTransactionMinedAsync(txHash); const log = abiDecoder.tryToDecodeLogOrNoop(subRes.logs[0]) as LogWithDecodedArgs< SubmissionContractEventArgs >; @@ -169,7 +168,7 @@ describe('MultiSigWalletWithTimeLock', () => { txHash = await multiSig.confirmTransaction.sendTransactionAsync(txId, { from: owners[1], }); - const confRes = await zeroEx.awaitTransactionMinedAsync(txHash); + const confRes = await web3Wrapper.awaitTransactionMinedAsync(txHash); expect(confRes.logs).to.have.length(2); }); const newSecondsTimeLocked = 0; diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts index 9e4f7ca3b..f2c0f5bc7 100644 --- a/packages/contracts/test/token_registry.ts +++ b/packages/contracts/test/token_registry.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber, NULL_BYTES } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -60,7 +59,7 @@ describe('TokenRegistry', () => { }; const nullToken = { - address: ZeroEx.NULL_ADDRESS, + address: constants.NULL_ADDRESS, name: '', symbol: '', decimals: 0, diff --git a/packages/contracts/test/tutorials/arbitrage.ts b/packages/contracts/test/tutorials/arbitrage.ts index 723ddb066..1a53871cd 100644 --- a/packages/contracts/test/tutorials/arbitrage.ts +++ b/packages/contracts/test/tutorials/arbitrage.ts @@ -38,7 +38,7 @@ // let amountGive: BigNumber; // let makerTokenAmount: BigNumber; // let takerTokenAmount: BigNumber; -// const feeRecipient = ZeroEx.NULL_ADDRESS; +// const feeRecipient = constants.NULL_ADDRESS; // const INITIAL_BALANCE = ZeroEx.toBaseUnitAmount(new BigNumber(10000), 18); // const INITIAL_ALLOWANCE = ZeroEx.toBaseUnitAmount(new BigNumber(10000), 18); @@ -115,7 +115,7 @@ // exchangeContractAddress: exchange.address, // networkId: constants.TESTRPC_NETWORK_ID, // }); -// exWrapper = new ExchangeWrapper(exchange, zeroEx); +// exWrapper = new ExchangeWrapper(exchange); // makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(1), 18); // takerTokenAmount = makerTokenAmount; diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index 5ad9321e8..147f77ab1 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -1,4 +1,4 @@ -import { ZeroEx } from '0x.js'; +import { ContractWrappers } from '@0xproject/contract-wrappers'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -19,7 +19,7 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('UnlimitedAllowanceToken', () => { let owner: string; let spender: string; - const zeroEx = new ZeroEx(provider, { + const contractWrappers = new ContractWrappers(provider, { networkId: constants.TESTRPC_NETWORK_ID, }); @@ -51,7 +51,7 @@ describe('UnlimitedAllowanceToken', () => { }); describe('transfer', () => { it('should throw if owner has insufficient balance', async () => { - const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const ownerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = ownerBalance.plus(1); return expect(token.transfer.callAsync(spender, amountToTransfer, { from: owner })).to.be.rejectedWith( constants.REVERT, @@ -60,11 +60,11 @@ describe('UnlimitedAllowanceToken', () => { it('should transfer balance from sender to receiver', async () => { const receiver = spender; - const initOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = new BigNumber(1); - await zeroEx.token.transferAsync(tokenAddress, owner, receiver, amountToTransfer); - const finalOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); - const finalReceiverBalance = await zeroEx.token.getBalanceAsync(tokenAddress, receiver); + await contractWrappers.token.transferAsync(tokenAddress, owner, receiver, amountToTransfer); + const finalOwnerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); + const finalReceiverBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, receiver); const expectedFinalOwnerBalance = initOwnerBalance.minus(amountToTransfer); const expectedFinalReceiverBalance = amountToTransfer; @@ -82,9 +82,9 @@ describe('UnlimitedAllowanceToken', () => { describe('transferFrom', () => { it('should throw if owner has insufficient balance', async () => { - const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const ownerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = ownerBalance.plus(1); - await zeroEx.token.setAllowanceAsync(tokenAddress, owner, spender, amountToTransfer); + await contractWrappers.token.setAllowanceAsync(tokenAddress, owner, spender, amountToTransfer); return expect( token.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender, @@ -93,10 +93,10 @@ describe('UnlimitedAllowanceToken', () => { }); it('should throw if spender has insufficient allowance', async () => { - const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const ownerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = ownerBalance; - const spenderAllowance = await zeroEx.token.getAllowanceAsync(tokenAddress, owner, spender); + const spenderAllowance = await contractWrappers.token.getAllowanceAsync(tokenAddress, owner, spender); const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; expect(isSpenderAllowanceInsufficient).to.be.true(); @@ -116,44 +116,44 @@ describe('UnlimitedAllowanceToken', () => { }); it('should not modify spender allowance if spender allowance is 2^256 - 1', async () => { - const initOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = initOwnerBalance; - const initSpenderAllowance = zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; - await zeroEx.token.setAllowanceAsync(tokenAddress, owner, spender, initSpenderAllowance); - await zeroEx.token.transferFromAsync(tokenAddress, owner, spender, spender, amountToTransfer, { + const initSpenderAllowance = contractWrappers.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; + await contractWrappers.token.setAllowanceAsync(tokenAddress, owner, spender, initSpenderAllowance); + await contractWrappers.token.transferFromAsync(tokenAddress, owner, spender, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_TRANSFERFROM_GAS, }); - const newSpenderAllowance = await zeroEx.token.getAllowanceAsync(tokenAddress, owner, spender); + const newSpenderAllowance = await contractWrappers.token.getAllowanceAsync(tokenAddress, owner, spender); expect(initSpenderAllowance).to.be.bignumber.equal(newSpenderAllowance); }); it('should transfer the correct balances if spender has sufficient allowance', async () => { - const initOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = initOwnerBalance; const initSpenderAllowance = initOwnerBalance; - await zeroEx.token.setAllowanceAsync(tokenAddress, owner, spender, initSpenderAllowance); - await zeroEx.token.transferFromAsync(tokenAddress, owner, spender, spender, amountToTransfer, { + await contractWrappers.token.setAllowanceAsync(tokenAddress, owner, spender, initSpenderAllowance); + await contractWrappers.token.transferFromAsync(tokenAddress, owner, spender, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_TRANSFERFROM_GAS, }); - const newOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); - const newSpenderBalance = await zeroEx.token.getBalanceAsync(tokenAddress, spender); + const newOwnerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); + const newSpenderBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, spender); expect(newOwnerBalance).to.be.bignumber.equal(0); expect(newSpenderBalance).to.be.bignumber.equal(initOwnerBalance); }); it('should modify allowance if spender has sufficient allowance less than 2^256 - 1', async () => { - const initOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(tokenAddress, owner); const amountToTransfer = initOwnerBalance; const initSpenderAllowance = initOwnerBalance; - await zeroEx.token.setAllowanceAsync(tokenAddress, owner, spender, initSpenderAllowance); - await zeroEx.token.transferFromAsync(tokenAddress, owner, spender, spender, amountToTransfer, { + await contractWrappers.token.setAllowanceAsync(tokenAddress, owner, spender, initSpenderAllowance); + await contractWrappers.token.transferFromAsync(tokenAddress, owner, spender, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_TRANSFERFROM_GAS, }); - const newSpenderAllowance = await zeroEx.token.getAllowanceAsync(tokenAddress, owner, spender); + const newSpenderAllowance = await contractWrappers.token.getAllowanceAsync(tokenAddress, owner, spender); expect(newSpenderAllowance).to.be.bignumber.equal(0); }); }); diff --git a/packages/contracts/test/utils/match_order_tester.ts b/packages/contracts/test/utils/match_order_tester.ts index 14930de08..6dbd7bfbc 100644 --- a/packages/contracts/test/utils/match_order_tester.ts +++ b/packages/contracts/test/utils/match_order_tester.ts @@ -1,5 +1,5 @@ -import { LogWithDecodedArgs, ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import { LogWithDecodedArgs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import ethUtil = require('ethereumjs-util'); diff --git a/packages/contracts/test/zrx_token.ts b/packages/contracts/test/zrx_token.ts index 48b8f6e36..d621d9065 100644 --- a/packages/contracts/test/zrx_token.ts +++ b/packages/contracts/test/zrx_token.ts @@ -1,4 +1,4 @@ -import { ZeroEx } from '0x.js'; +import { ContractWrappers } from '@0xproject/contract-wrappers'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -19,7 +19,7 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('ZRXToken', () => { let owner: string; let spender: string; - let zeroEx: ZeroEx; + let contractWrappers: ContractWrappers; let MAX_UINT: BigNumber; @@ -30,12 +30,12 @@ describe('ZRXToken', () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); owner = accounts[0]; spender = accounts[1]; - zeroEx = new ZeroEx(provider, { + contractWrappers = new ContractWrappers(provider, { networkId: constants.TESTRPC_NETWORK_ID, }); zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRX, provider, txDefaults); zrxAddress = zrxToken.address; - MAX_UINT = zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; + MAX_UINT = contractWrappers.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; }); beforeEach(async () => { await blockchainLifecycle.startAsync(); @@ -53,7 +53,7 @@ describe('ZRXToken', () => { it('should have a total supply of 1 billion tokens', async () => { const totalSupply = new BigNumber(await zrxToken.totalSupply.callAsync()); const expectedTotalSupply = 1000000000; - expect(ZeroEx.toUnitAmount(totalSupply, 18)).to.be.bignumber.equal(expectedTotalSupply); + expect(Web3Wrapper.toUnitAmount(totalSupply, 18)).to.be.bignumber.equal(expectedTotalSupply); }); it('should be named 0x Protocol Token', async () => { @@ -71,7 +71,7 @@ describe('ZRXToken', () => { describe('constructor', () => { it('should initialize owner balance to totalSupply', async () => { - const ownerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); + const ownerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); const totalSupply = new BigNumber(await zrxToken.totalSupply.callAsync()); expect(totalSupply).to.be.bignumber.equal(ownerBalance); }); @@ -80,11 +80,11 @@ describe('ZRXToken', () => { describe('transfer', () => { it('should transfer balance from sender to receiver', async () => { const receiver = spender; - const initOwnerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); const amountToTransfer = new BigNumber(1); - await zeroEx.token.transferAsync(zrxAddress, owner, receiver, amountToTransfer); - const finalOwnerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); - const finalReceiverBalance = await zeroEx.token.getBalanceAsync(zrxAddress, receiver); + await contractWrappers.token.transferAsync(zrxAddress, owner, receiver, amountToTransfer); + const finalOwnerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); + const finalReceiverBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, receiver); const expectedFinalOwnerBalance = initOwnerBalance.minus(amountToTransfer); const expectedFinalReceiverBalance = amountToTransfer; @@ -102,9 +102,9 @@ describe('ZRXToken', () => { describe('transferFrom', () => { it('should return false if owner has insufficient balance', async () => { - const ownerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); + const ownerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); const amountToTransfer = ownerBalance.plus(1); - await zeroEx.token.setAllowanceAsync(zrxAddress, owner, spender, amountToTransfer, { + await contractWrappers.token.setAllowanceAsync(zrxAddress, owner, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_APPROVE_GAS, }); const didReturnTrue = await zrxToken.transferFrom.callAsync(owner, spender, amountToTransfer, { @@ -114,10 +114,10 @@ describe('ZRXToken', () => { }); it('should return false if spender has insufficient allowance', async () => { - const ownerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); + const ownerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); const amountToTransfer = ownerBalance; - const spenderAllowance = await zeroEx.token.getAllowanceAsync(zrxAddress, owner, spender); + const spenderAllowance = await contractWrappers.token.getAllowanceAsync(zrxAddress, owner, spender); const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; expect(isSpenderAllowanceInsufficient).to.be.true(); @@ -136,46 +136,46 @@ describe('ZRXToken', () => { }); it('should not modify spender allowance if spender allowance is 2^256 - 1', async () => { - const initOwnerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); const amountToTransfer = initOwnerBalance; const initSpenderAllowance = MAX_UINT; - await zeroEx.token.setAllowanceAsync(zrxAddress, owner, spender, initSpenderAllowance, { + await contractWrappers.token.setAllowanceAsync(zrxAddress, owner, spender, initSpenderAllowance, { gasLimit: constants.MAX_TOKEN_APPROVE_GAS, }); - await zeroEx.token.transferFromAsync(zrxAddress, owner, spender, spender, amountToTransfer, { + await contractWrappers.token.transferFromAsync(zrxAddress, owner, spender, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_TRANSFERFROM_GAS, }); - const newSpenderAllowance = await zeroEx.token.getAllowanceAsync(zrxAddress, owner, spender); + const newSpenderAllowance = await contractWrappers.token.getAllowanceAsync(zrxAddress, owner, spender); expect(initSpenderAllowance).to.be.bignumber.equal(newSpenderAllowance); }); it('should transfer the correct balances if spender has sufficient allowance', async () => { - const initOwnerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); - const initSpenderBalance = await zeroEx.token.getBalanceAsync(zrxAddress, spender); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); + const initSpenderBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, spender); const amountToTransfer = initOwnerBalance; const initSpenderAllowance = initOwnerBalance; - await zeroEx.token.setAllowanceAsync(zrxAddress, owner, spender, initSpenderAllowance); - await zeroEx.token.transferFromAsync(zrxAddress, owner, spender, spender, amountToTransfer, { + await contractWrappers.token.setAllowanceAsync(zrxAddress, owner, spender, initSpenderAllowance); + await contractWrappers.token.transferFromAsync(zrxAddress, owner, spender, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_TRANSFERFROM_GAS, }); - const newOwnerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); - const newSpenderBalance = await zeroEx.token.getBalanceAsync(zrxAddress, spender); + const newOwnerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); + const newSpenderBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, spender); expect(newOwnerBalance).to.be.bignumber.equal(0); expect(newSpenderBalance).to.be.bignumber.equal(initSpenderBalance.plus(initOwnerBalance)); }); it('should modify allowance if spender has sufficient allowance less than 2^256 - 1', async () => { - const initOwnerBalance = await zeroEx.token.getBalanceAsync(zrxAddress, owner); + const initOwnerBalance = await contractWrappers.token.getBalanceAsync(zrxAddress, owner); const amountToTransfer = initOwnerBalance; - await zeroEx.token.setAllowanceAsync(zrxAddress, owner, spender, amountToTransfer); - await zeroEx.token.transferFromAsync(zrxAddress, owner, spender, spender, amountToTransfer, { + await contractWrappers.token.setAllowanceAsync(zrxAddress, owner, spender, amountToTransfer); + await contractWrappers.token.transferFromAsync(zrxAddress, owner, spender, spender, amountToTransfer, { gasLimit: constants.MAX_TOKEN_TRANSFERFROM_GAS, }); - const newSpenderAllowance = await zeroEx.token.getAllowanceAsync(zrxAddress, owner, spender); + const newSpenderAllowance = await contractWrappers.token.getAllowanceAsync(zrxAddress, owner, spender); expect(newSpenderAllowance).to.be.bignumber.equal(0); }); }); diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 75cf03b05..799f716f3 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -46,7 +46,7 @@ "tslint": "5.8.0", "tslint-eslint-rules": "^4.1.1", "tslint-react": "^3.2.0", - "tsutils": "^2.12.1" + "tsutils": "2.22.2" }, "publishConfig": { "access": "public" diff --git a/yarn.lock b/yarn.lock index 6f1b7b931..4b4e0dba0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,12 +6,98 @@ version "0.3.9" resolved "https://registry.yarnpkg.com/8fold-marked/-/8fold-marked-0.3.9.tgz#bb89c645612f8ccfaffac1ca6e3c11f168c9cf59" +"@0xproject/assert@^0.2.10": + version "0.2.10" + resolved "https://registry.yarnpkg.com/@0xproject/assert/-/assert-0.2.10.tgz#733bcf7f9483ac65f1d68fbc6534322242c4b919" + dependencies: + "@0xproject/json-schemas" "^0.7.24" + "@0xproject/typescript-typings" "^0.3.2" + "@0xproject/utils" "^0.6.2" + lodash "^4.17.4" + valid-url "^1.0.9" + +"@0xproject/base-contract@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@0xproject/base-contract/-/base-contract-0.3.2.tgz#d7ffdc6ae26fc73bbd43b62dafcfae019d8f984a" + dependencies: + "@0xproject/types" "^0.7.0" + "@0xproject/typescript-typings" "^0.3.2" + "@0xproject/utils" "^0.6.2" + "@0xproject/web3-wrapper" "^0.6.4" + ethers "^3.0.15" + lodash "^4.17.4" + +"@0xproject/contract-wrappers@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@0xproject/contract-wrappers/-/contract-wrappers-0.0.2.tgz#6e297db4650eeabc7d3d2f7c39d64561c021eab6" + dependencies: + "@0xproject/assert" "^0.2.10" + "@0xproject/base-contract" "^0.3.2" + "@0xproject/fill-scenarios" "^0.0.2" + "@0xproject/json-schemas" "^0.7.24" + "@0xproject/order-utils" "^0.0.5" + "@0xproject/types" "^0.7.0" + "@0xproject/typescript-typings" "^0.3.2" + "@0xproject/utils" "^0.6.2" + "@0xproject/web3-wrapper" "^0.6.4" + ethereumjs-blockstream "^2.0.6" + ethereumjs-util "^5.1.1" + ethers "^3.0.15" + js-sha3 "^0.7.0" + lodash "^4.17.4" + uuid "^3.1.0" + +"@0xproject/fill-scenarios@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@0xproject/fill-scenarios/-/fill-scenarios-0.0.2.tgz#176ac2cba13f527e84346fbf06da84965a852bab" + dependencies: + "@0xproject/base-contract" "^0.3.2" + "@0xproject/order-utils" "^0.0.5" + "@0xproject/types" "^0.7.0" + "@0xproject/typescript-typings" "^0.3.2" + "@0xproject/utils" "^0.6.2" + "@0xproject/web3-wrapper" "^0.6.4" + ethers "^3.0.15" + lodash "^4.17.4" + +"@0xproject/json-schemas@^0.7.24": + version "0.7.24" + resolved "https://registry.yarnpkg.com/@0xproject/json-schemas/-/json-schemas-0.7.24.tgz#21a12b43ab0ab4aa302d02c4891668cda36b6c64" + dependencies: + "@0xproject/typescript-typings" "^0.3.2" + "@types/node" "^8.0.53" + jsonschema "^1.2.0" + lodash.values "^4.3.0" + +"@0xproject/order-utils@^0.0.5": + version "0.0.5" + resolved "https://registry.yarnpkg.com/@0xproject/order-utils/-/order-utils-0.0.5.tgz#c8d92a112740b0020e08f13137844f8c183c863b" + dependencies: + "@0xproject/assert" "^0.2.10" + "@0xproject/json-schemas" "^0.7.24" + "@0xproject/types" "^0.7.0" + "@0xproject/typescript-typings" "^0.3.2" + "@0xproject/utils" "^0.6.2" + "@0xproject/web3-wrapper" "^0.6.4" + "@types/node" "^8.0.53" + bn.js "^4.11.8" + ethereumjs-abi "^0.6.4" + ethereumjs-util "^5.1.1" + lodash "^4.17.4" + "@0xproject/types@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.5.0.tgz#ba3cfbc11a8c6344b57c9680aa7df2ea84b9bf05" dependencies: bignumber.js "~4.1.0" +"@0xproject/types@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.7.0.tgz#fad13925ee92ad4ee1980668a5cb2bed4dcaab8f" + dependencies: + "@types/node" "^8.0.53" + bignumber.js "~4.1.0" + "@0xproject/typescript-typings@^0.0.3": version "0.0.3" resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-0.0.3.tgz#3272080bde00ade0a970b0d236686b483b08a1d0" @@ -19,6 +105,37 @@ "@0xproject/types" "^0.5.0" bignumber.js "~4.1.0" +"@0xproject/typescript-typings@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-0.3.2.tgz#abc360b441afda993100450ca8369dfabf75936b" + dependencies: + "@0xproject/types" "^0.7.0" + bignumber.js "~4.1.0" + +"@0xproject/utils@^0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@0xproject/utils/-/utils-0.6.2.tgz#79056a0a7be88581bcb92bce01a0f1f1b3074397" + dependencies: + "@0xproject/types" "^0.7.0" + "@0xproject/typescript-typings" "^0.3.2" + "@types/node" "^8.0.53" + bignumber.js "~4.1.0" + ethers "^3.0.15" + js-sha3 "^0.7.0" + lodash "^4.17.4" + web3 "^0.20.0" + +"@0xproject/web3-wrapper@^0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@0xproject/web3-wrapper/-/web3-wrapper-0.6.4.tgz#fb15b71cdf4e5001c2b2e0d316b0de485a2be5f8" + dependencies: + "@0xproject/types" "^0.7.0" + "@0xproject/typescript-typings" "^0.3.2" + "@0xproject/utils" "^0.6.2" + ethers "^3.0.15" + lodash "^4.17.4" + web3 "^0.20.0" + "@ledgerhq/hw-app-eth@^4.3.0": version "4.7.3" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.7.3.tgz#d352e19658ae296532e522c53c8ec2a1a77b64e5" -- cgit v1.2.3 From 2ac2ae3eee50379cb99baf88448921a1850c2a54 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:19:09 -0700 Subject: Fix tsutils version --- yarn.lock | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yarn.lock b/yarn.lock index 4b4e0dba0..ac2432d98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11599,6 +11599,12 @@ tslint@^5.9.1: tslib "^1.8.0" tsutils "^2.12.1" +tsutils@2.22.2: + version "2.22.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.22.2.tgz#0b9f3d87aa3eb95bd32d26ce2b88aa329a657951" + dependencies: + tslib "^1.8.1" + tsutils@^1.4.0: version "1.9.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" -- cgit v1.2.3 From 9119ee14b6d49b2c339b786f92913ff8a93ff610 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:19:19 -0700 Subject: Update artifact --- .../artifacts/1.0.0/DummyERC20Token.json | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/migrations/artifacts/1.0.0/DummyERC20Token.json b/packages/migrations/artifacts/1.0.0/DummyERC20Token.json index 808652210..3ac218e24 100644 --- a/packages/migrations/artifacts/1.0.0/DummyERC20Token.json +++ b/packages/migrations/artifacts/1.0.0/DummyERC20Token.json @@ -305,14 +305,14 @@ "evm": { "bytecode": { "linkReferences": {}, - "object": "0x60806040523480156200001157600080fd5b506040516200193b3803806200193b833981018060405262000037919081019062000228565b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600490805190602001906200009092919062000105565b508260059080519060200190620000a992919062000105565b508160068190555080600281905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505062000361565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014857805160ff191683800117855562000179565b8280016001018555821562000179579182015b82811115620001785782518255916020019190600101906200015b565b5b5090506200018891906200018c565b5090565b620001b191905b80821115620001ad57600081600090555060010162000193565b5090565b90565b600082601f8301121515620001c857600080fd5b8151620001df620001d982620002f4565b620002c6565b91508082526020830160208301858383011115620001fc57600080fd5b620002098382846200032b565b50505092915050565b600062000220825162000321565b905092915050565b600080600080608085870312156200023f57600080fd5b600085015167ffffffffffffffff8111156200025a57600080fd5b6200026887828801620001b4565b945050602085015167ffffffffffffffff8111156200028657600080fd5b6200029487828801620001b4565b9350506040620002a78782880162000212565b9250506060620002ba8782880162000212565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620002ea57600080fd5b8060405250919050565b600067ffffffffffffffff8211156200030c57600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b60005b838110156200034b5780820151818401526020810190506200032e565b838111156200035b576000848401525b50505050565b6115ca80620003716000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a72305820dbb48ab34f59e30595d90684cb2e3bf356f8749f5dd5e617ce527adda15d5c346c6578706572696d656e74616cf50037", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x193B CODESIZE SUB DUP1 PUSH3 0x193B DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x228 JUMP JUMPDEST CALLER PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x4 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x90 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP3 PUSH1 0x5 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0xA9 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP2 PUSH1 0x6 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP POP PUSH3 0x361 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x148 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x179 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x179 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x178 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x15B JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x188 SWAP2 SWAP1 PUSH3 0x18C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x1B1 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x1AD JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x193 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT ISZERO ISZERO PUSH3 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x1DF PUSH3 0x1D9 DUP3 PUSH3 0x2F4 JUMP JUMPDEST PUSH3 0x2C6 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x209 DUP4 DUP3 DUP5 PUSH3 0x32B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x220 DUP3 MLOAD PUSH3 0x321 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH3 0x23F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x25A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x268 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x286 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x294 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 PUSH3 0x2A7 DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 PUSH3 0x2BA DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP DUP2 DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH3 0x2EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x40 MSTORE POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH3 0x30C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x34B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH3 0x32E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x35B JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x15CA DUP1 PUSH3 0x371 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xdb 0xb4 DUP11 0xb3 0x4f MSIZE 0xe3 SDIV SWAP6 0xd9 MOD DUP5 0xcb 0x2e EXTCODESIZE RETURN JUMP 0xf8 PUSH21 0x9F5DD5E617CE527ADDA15D5C346C6578706572696D PUSH6 0x6E74616CF500 CALLDATACOPY ", + "object": "0x60806040523480156200001157600080fd5b506040516200193b3803806200193b833981018060405262000037919081019062000228565b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600490805190602001906200009092919062000105565b508260059080519060200190620000a992919062000105565b508160068190555080600281905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505062000361565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014857805160ff191683800117855562000179565b8280016001018555821562000179579182015b82811115620001785782518255916020019190600101906200015b565b5b5090506200018891906200018c565b5090565b620001b191905b80821115620001ad57600081600090555060010162000193565b5090565b90565b600082601f8301121515620001c857600080fd5b8151620001df620001d982620002f4565b620002c6565b91508082526020830160208301858383011115620001fc57600080fd5b620002098382846200032b565b50505092915050565b600062000220825162000321565b905092915050565b600080600080608085870312156200023f57600080fd5b600085015167ffffffffffffffff8111156200025a57600080fd5b6200026887828801620001b4565b945050602085015167ffffffffffffffff8111156200028657600080fd5b6200029487828801620001b4565b9350506040620002a78782880162000212565b9250506060620002ba8782880162000212565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620002ea57600080fd5b8060405250919050565b600067ffffffffffffffff8211156200030c57600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b60005b838110156200034b5780820151818401526020810190506200032e565b838111156200035b576000848401525b50505050565b6115ca80620003716000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a723058208f9c89c6f85f64aec1e07cbf745526bbd793fd4abc535035dd77ee4efbc898c36c6578706572696d656e74616cf50037", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x193B CODESIZE SUB DUP1 PUSH3 0x193B DUP4 CODECOPY DUP2 ADD DUP1 PUSH1 0x40 MSTORE PUSH3 0x37 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH3 0x228 JUMP JUMPDEST CALLER PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP4 PUSH1 0x4 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0x90 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP3 PUSH1 0x5 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH3 0xA9 SWAP3 SWAP2 SWAP1 PUSH3 0x105 JUMP JUMPDEST POP DUP2 PUSH1 0x6 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP DUP1 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP POP PUSH3 0x361 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH3 0x148 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH3 0x179 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH3 0x179 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH3 0x178 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH3 0x15B JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH3 0x188 SWAP2 SWAP1 PUSH3 0x18C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH3 0x1B1 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH3 0x1AD JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH3 0x193 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT ISZERO ISZERO PUSH3 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 MLOAD PUSH3 0x1DF PUSH3 0x1D9 DUP3 PUSH3 0x2F4 JUMP JUMPDEST PUSH3 0x2C6 JUMP JUMPDEST SWAP2 POP DUP1 DUP3 MSTORE PUSH1 0x20 DUP4 ADD PUSH1 0x20 DUP4 ADD DUP6 DUP4 DUP4 ADD GT ISZERO PUSH3 0x1FC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x209 DUP4 DUP3 DUP5 PUSH3 0x32B JUMP JUMPDEST POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x220 DUP3 MLOAD PUSH3 0x321 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH1 0x80 DUP6 DUP8 SUB SLT ISZERO PUSH3 0x23F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x25A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x268 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP5 POP POP PUSH1 0x20 DUP6 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH3 0x286 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x294 DUP8 DUP3 DUP9 ADD PUSH3 0x1B4 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x40 PUSH3 0x2A7 DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x60 PUSH3 0x2BA DUP8 DUP3 DUP9 ADD PUSH3 0x212 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP6 SWAP2 SWAP5 POP SWAP3 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP DUP2 DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH3 0x2EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x40 MSTORE POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH3 0x30C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH3 0x34B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH3 0x32E JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH3 0x35B JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x15CA DUP1 PUSH3 0x371 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 DUP16 SWAP13 DUP10 0xc6 0xf8 0x5f PUSH5 0xAEC1E07CBF PUSH21 0x5526BBD793FD4ABC535035DD77EE4EFBC898C36C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ", "sourceMap": "718:844:0:-;;;850:302;8:9:-1;5:2;;;30:1;27;20:12;5:2;850:302:0;;;;;;;;;;;;;;;;;;;;;;;;371:10:6;363:5;;:18;;;;;;;;;;;;;;;;;;1003:5:0;996:4;:12;;;;;;;;;;;;:::i;:::-;;1027:7;1018:6;:16;;;;;;;;;;;;:::i;:::-;;1055:9;1044:8;:20;;;;1088:12;1074:11;:26;;;;1133:12;1110:8;:20;1119:10;1110:20;;;;;;;;;;;;;;;:35;;;;850:302;;;;718:844;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6:444:-1:-;;119:3;112:4;104:6;100:17;96:27;89:35;86:2;;;137:1;134;127:12;86:2;167:6;161:13;189:65;204:49;246:6;204:49;;;189:65;;;180:74;;274:6;267:5;260:21;310:4;302:6;298:17;343:4;336:5;332:16;378:3;369:6;364:3;360:16;357:25;354:2;;;395:1;392;385:12;354:2;405:39;437:6;432:3;427;405:39;;;79:371;;;;;;;;458:122;;536:39;567:6;561:13;536:39;;;527:48;;521:59;;;;;587:870;;;;;773:3;761:9;752:7;748:23;744:33;741:2;;;790:1;787;780:12;741:2;846:1;835:9;831:17;825:24;869:18;861:6;858:30;855:2;;;901:1;898;891:12;855:2;921:74;987:7;978:6;967:9;963:22;921:74;;;911:84;;804:197;1053:2;1042:9;1038:18;1032:25;1077:18;1069:6;1066:30;1063:2;;;1109:1;1106;1099:12;1063:2;1129:74;1195:7;1186:6;1175:9;1171:22;1129:74;;;1119:84;;1011:198;1240:2;1258:64;1314:7;1305:6;1294:9;1290:22;1258:64;;;1248:74;;1219:109;1359:2;1377:64;1433:7;1424:6;1413:9;1409:22;1377:64;;;1367:74;;1338:109;735:722;;;;;;;;1464:256;;1526:2;1520:9;1510:19;;1564:4;1556:6;1552:17;1663:6;1651:10;1648:22;1627:18;1615:10;1612:34;1609:62;1606:2;;;1684:1;1681;1674:12;1606:2;1704:10;1700:2;1693:22;1504:216;;;;;1727:259;;1871:18;1863:6;1860:30;1857:2;;;1903:1;1900;1893:12;1857:2;1947:4;1943:9;1936:4;1928:6;1924:17;1920:33;1912:41;;1976:4;1970;1966:15;1958:23;;1794:192;;;;1993:79;;2062:5;2051:16;;2045:27;;;;2080:268;2145:1;2152:101;2166:6;2163:1;2160:13;2152:101;;;2242:1;2237:3;2233:11;2227:18;2223:1;2218:3;2214:11;2207:39;2188:2;2185:1;2181:10;2176:15;;2152:101;;;2268:6;2265:1;2262:13;2259:2;;;2333:1;2324:6;2319:3;2315:16;2308:27;2259:2;2129:219;;;;;718:844:0;;;;;;;" }, "deployedBytecode": { "linkReferences": {}, - "object": "0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a72305820dbb48ab34f59e30595d90684cb2e3bf356f8749f5dd5e617ce527adda15d5c346c6578706572696d656e74616cf50037", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 0xdb 0xb4 DUP11 0xb3 0x4f MSIZE 0xe3 SDIV SWAP6 0xd9 MOD DUP5 0xcb 0x2e EXTCODESIZE RETURN JUMP 0xf8 PUSH21 0x9F5DD5E617CE527ADDA15D5C346C6578706572696D PUSH6 0x6E74616CF500 CALLDATACOPY ", + "object": "0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b3146100f557806318160ddd1461013257806323b872dd1461015d578063313ce5671461019a57806370a08231146101c55780638da5cb5b1461020257806395d89b411461022d578063a0712d6814610258578063a9059cbb14610281578063dd62ed3e146102be578063e30443bc146102fb578063f2fde38b14610324575b600080fd5b3480156100d657600080fd5b506100df61034d565b6040516100ec9190611464565b60405180910390f35b34801561010157600080fd5b5061011c600480360361011791908101906112ac565b6103eb565b6040516101299190611449565b60405180910390f35b34801561013e57600080fd5b506101476104dd565b60405161015491906114c6565b60405180910390f35b34801561016957600080fd5b50610184600480360361017f919081019061125d565b6104e3565b6040516101919190611449565b60405180910390f35b3480156101a657600080fd5b506101af6109cc565b6040516101bc91906114c6565b60405180910390f35b3480156101d157600080fd5b506101ec60048036036101e791908101906111f8565b6109d2565b6040516101f991906114c6565b60405180910390f35b34801561020e57600080fd5b50610217610a1a565b604051610224919061142e565b60405180910390f35b34801561023957600080fd5b50610242610a40565b60405161024f9190611464565b60405180910390f35b34801561026457600080fd5b5061027f600480360361027a91908101906112e8565b610ade565b005b34801561028d57600080fd5b506102a860048036036102a391908101906112ac565b610bcb565b6040516102b59190611449565b60405180910390f35b3480156102ca57600080fd5b506102e560048036036102e09190810190611221565b610eda565b6040516102f291906114c6565b60405180910390f35b34801561030757600080fd5b50610322600480360361031d91908101906112ac565b610f61565b005b34801561033057600080fd5b5061034b600480360361034691908101906111f8565b61108c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb91906114c6565b60405180910390a36001905092915050565b60025481565b600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e9190611464565b60405180910390fd5b5082811015606060405190810160405280602c81526020017f496e73756666696369656e7420616c6c6f77616e636520746f20636f6d706c6581526020017f7465207472616e736665722e00000000000000000000000000000000000000008152509015156106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e39190611464565b60405180910390fd5b506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e00000000000000000000000000000000000000000000000000000081525090151561080f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108069190611464565b60405180910390fd5b50826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561095b5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516109b891906114c6565b60405180910390a360019150509392505050565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b68056bc75e2d631000008111151515610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b23906114a6565b60405180910390fd5b610b74816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611199565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc260025482611199565b60028190555050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015606060405190810160405280602a81526020017f496e73756666696369656e742062616c616e636520746f20636f6d706c65746581526020017f207472616e736665722e00000000000000000000000000000000000000000000815250901515610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca69190611464565b60405180910390fd5b506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015606060405190810160405280602581526020017f5472616e7366657220776f756c6420726573756c7420696e20616e206f76657281526020017f666c6f772e000000000000000000000000000000000000000000000000000000815250901515610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc99190611464565b60405180910390fd5b50816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ec891906114c6565b60405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90611486565b60405180910390fd5b610ffe836109d2565b9050808210156110285761101d60025461101883856111b7565b6111b7565b600281905550611044565b61103d60025461103884846111b7565b611199565b6002819055505b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590611486565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156111965780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101515156111ad57fe5b8091505092915050565b60008282111515156111c557fe5b818303905092915050565b60006111dc8235611522565b905092915050565b60006111f08235611542565b905092915050565b60006020828403121561120a57600080fd5b6000611218848285016111d0565b91505092915050565b6000806040838503121561123457600080fd5b6000611242858286016111d0565b9250506020611253858286016111d0565b9150509250929050565b60008060006060848603121561127257600080fd5b6000611280868287016111d0565b9350506020611291868287016111d0565b92505060406112a2868287016111e4565b9150509250925092565b600080604083850312156112bf57600080fd5b60006112cd858286016111d0565b92505060206112de858286016111e4565b9150509250929050565b6000602082840312156112fa57600080fd5b6000611308848285016111e4565b91505092915050565b61131a816114ec565b82525050565b6113298161150c565b82525050565b600061133a826114e1565b80845261134e81602086016020860161154c565b6113578161157f565b602085010191505092915050565b6000603382527f4f6e6c7920636f6e7472616374206f776e657220697320616c6c6f776564207460208301527f6f2063616c6c2074686973206d6574686f642e000000000000000000000000006040830152606082019050919050565b6000603782527f4d696e74696e67206d6f7265207468616e20313030303030303030303030303060208301527f30303030303030206973206e6f7420616c6c6f7765642e0000000000000000006040830152606082019050919050565b61142881611518565b82525050565b60006020820190506114436000830184611311565b92915050565b600060208201905061145e6000830184611320565b92915050565b6000602082019050818103600083015261147e818461132f565b905092915050565b6000602082019050818103600083015261149f81611365565b9050919050565b600060208201905081810360008301526114bf816113c2565b9050919050565b60006020820190506114db600083018461141f565b92915050565b600081519050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561156a57808201518184015260208101905061154f565b83811115611579576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a723058208f9c89c6f85f64aec1e07cbf745526bbd793fd4abc535035dd77ee4efbc898c36c6578706572696d656e74616cf50037", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xC5 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x6FDDE03 EQ PUSH2 0xCA JUMPI DUP1 PUSH4 0x95EA7B3 EQ PUSH2 0xF5 JUMPI DUP1 PUSH4 0x18160DDD EQ PUSH2 0x132 JUMPI DUP1 PUSH4 0x23B872DD EQ PUSH2 0x15D JUMPI DUP1 PUSH4 0x313CE567 EQ PUSH2 0x19A JUMPI DUP1 PUSH4 0x70A08231 EQ PUSH2 0x1C5 JUMPI DUP1 PUSH4 0x8DA5CB5B EQ PUSH2 0x202 JUMPI DUP1 PUSH4 0x95D89B41 EQ PUSH2 0x22D JUMPI DUP1 PUSH4 0xA0712D68 EQ PUSH2 0x258 JUMPI DUP1 PUSH4 0xA9059CBB EQ PUSH2 0x281 JUMPI DUP1 PUSH4 0xDD62ED3E EQ PUSH2 0x2BE JUMPI DUP1 PUSH4 0xE30443BC EQ PUSH2 0x2FB JUMPI DUP1 PUSH4 0xF2FDE38B EQ PUSH2 0x324 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xD6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xDF PUSH2 0x34D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xEC SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x101 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x11C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x117 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0x3EB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x129 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x13E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x147 PUSH2 0x4DD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x154 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x169 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x184 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x17F SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x125D JUMP JUMPDEST PUSH2 0x4E3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x191 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1AF PUSH2 0x9CC JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1BC SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1D1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1EC PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x1E7 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x9D2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F9 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x20E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x217 PUSH2 0xA1A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x224 SWAP2 SWAP1 PUSH2 0x142E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x239 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x242 PUSH2 0xA40 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x24F SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x264 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x27F PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x27A SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12E8 JUMP JUMPDEST PUSH2 0xADE JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x28D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2A8 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2A3 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xBCB JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2B5 SWAP2 SWAP1 PUSH2 0x1449 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2CA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x2E0 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x1221 JUMP JUMPDEST PUSH2 0xEDA JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2F2 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x307 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x322 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x31D SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x12AC JUMP JUMPDEST PUSH2 0xF61 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x330 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x34B PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH2 0x346 SWAP2 SWAP1 DUP2 ADD SWAP1 PUSH2 0x11F8 JUMP JUMPDEST PUSH2 0x108C JUMP JUMPDEST STOP JUMPDEST PUSH1 0x4 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x3E3 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B8 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3E3 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C6 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x8C5BE1E5EBEC7D5BD14F71427D1E84F3DD0314C0F7B2291E5B200AC8C7C3B925 DUP5 PUSH1 0x40 MLOAD PUSH2 0x4CB SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x1 PUSH1 0x0 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x647 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x63E SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 DUP2 LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2C DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E7420616C6C6F77616E636520746F20636F6D706C65 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7465207472616E736665722E0000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x6EC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x6E3 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP4 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0x80F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x806 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH1 0x0 DUP1 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP2 LT ISZERO PUSH2 0x95B JUMPI DUP3 PUSH1 0x1 PUSH1 0x0 DUP8 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP6 PUSH1 0x40 MLOAD PUSH2 0x9B8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP2 POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x6 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x5 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0xAD6 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xAAB JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0xAD6 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xAB9 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP DUP2 JUMP JUMPDEST PUSH9 0x56BC75E2D63100000 DUP2 GT ISZERO ISZERO ISZERO PUSH2 0xB2C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xB23 SWAP1 PUSH2 0x14A6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB74 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH2 0xBC2 PUSH1 0x2 SLOAD DUP3 PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x2A DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x496E73756666696369656E742062616C616E636520746F20636F6D706C657465 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x207472616E736665722E00000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xCAF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xCA6 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP PUSH1 0x0 DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD DUP3 PUSH1 0x0 DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD ADD LT ISZERO PUSH1 0x60 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x25 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x5472616E7366657220776F756C6420726573756C7420696E20616E206F766572 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x666C6F772E000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 ISZERO ISZERO PUSH2 0xDD2 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xDC9 SWAP2 SWAP1 PUSH2 0x1464 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST POP DUP2 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD SUB SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0xDDF252AD1BE2C89B69C2B068FC378DAA952BA7F163C4A11628F55A4DF523B3EF DUP5 PUSH1 0x40 MLOAD PUSH2 0xEC8 SWAP2 SWAP1 PUSH2 0x14C6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 PUSH1 0x1 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 SLOAD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0xFF5 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFEC SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xFFE DUP4 PUSH2 0x9D2 JUMP JUMPDEST SWAP1 POP DUP1 DUP3 LT ISZERO PUSH2 0x1028 JUMPI PUSH2 0x101D PUSH1 0x2 SLOAD PUSH2 0x1018 DUP4 DUP6 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x11B7 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH2 0x1044 JUMP JUMPDEST PUSH2 0x103D PUSH1 0x2 SLOAD PUSH2 0x1038 DUP5 DUP5 PUSH2 0x11B7 JUMP JUMPDEST PUSH2 0x1199 JUMP JUMPDEST PUSH1 0x2 DUP2 SWAP1 SSTORE POP JUMPDEST DUP2 PUSH1 0x0 DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x111E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1115 SWAP1 PUSH2 0x1486 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x1196 JUMPI DUP1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO ISZERO ISZERO PUSH2 0x11AD JUMPI INVALID JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 GT ISZERO ISZERO ISZERO PUSH2 0x11C5 JUMPI INVALID JUMPDEST DUP2 DUP4 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11DC DUP3 CALLDATALOAD PUSH2 0x1522 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x11F0 DUP3 CALLDATALOAD PUSH2 0x1542 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x120A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1218 DUP5 DUP3 DUP6 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x1234 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1242 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x1253 DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x1272 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1280 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x1291 DUP7 DUP3 DUP8 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 PUSH2 0x12A2 DUP7 DUP3 DUP8 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x12BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x12CD DUP6 DUP3 DUP7 ADD PUSH2 0x11D0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x12DE DUP6 DUP3 DUP7 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x12FA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1308 DUP5 DUP3 DUP6 ADD PUSH2 0x11E4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x131A DUP2 PUSH2 0x14EC JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x1329 DUP2 PUSH2 0x150C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x133A DUP3 PUSH2 0x14E1 JUMP JUMPDEST DUP1 DUP5 MSTORE PUSH2 0x134E DUP2 PUSH1 0x20 DUP7 ADD PUSH1 0x20 DUP7 ADD PUSH2 0x154C JUMP JUMPDEST PUSH2 0x1357 DUP2 PUSH2 0x157F JUMP JUMPDEST PUSH1 0x20 DUP6 ADD ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x33 DUP3 MSTORE PUSH32 0x4F6E6C7920636F6E7472616374206F776E657220697320616C6C6F7765642074 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x6F2063616C6C2074686973206D6574686F642E00000000000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x37 DUP3 MSTORE PUSH32 0x4D696E74696E67206D6F7265207468616E203130303030303030303030303030 PUSH1 0x20 DUP4 ADD MSTORE PUSH32 0x30303030303030206973206E6F7420616C6C6F7765642E000000000000000000 PUSH1 0x40 DUP4 ADD MSTORE PUSH1 0x60 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x1428 DUP2 PUSH2 0x1518 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x1443 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1311 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x145E PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x1320 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x147E DUP2 DUP5 PUSH2 0x132F JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x149F DUP2 PUSH2 0x1365 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x14BF DUP2 PUSH2 0x13C2 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x14DB PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x141F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x156A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x154F JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x1579 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP STOP LOG2 PUSH6 0x627A7A723058 KECCAK256 DUP16 SWAP13 DUP10 0xc6 0xf8 0x5f PUSH5 0xAEC1E07CBF PUSH21 0x5526BBD793FD4ABC535035DD77EE4EFBC898C36C65 PUSH25 0x706572696D656E74616CF50037000000000000000000000000 ", "sourceMap": "718:844:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;770:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;770:18:0;;;;;;;;;;;;;;;;;;;;2171:222:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2171:222:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1073:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1073:26:2;;;;;;;;;;;;;;;;;;;;1108:697:4;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1108:697:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:23:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:23:0;;;;;;;;;;;;;;;;;;;;2399:125:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2399:125:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;292:20:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;292:20:6;;;;;;;;;;;;;;;;;;;;794::0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;794:20:0;;;;;;;;;;;;;;;;;;;;905:321:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;905:321:1;;;;;;;;;;;;;;;;;;;1106:445:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1106:445:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2530:160;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2530:160:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1158:402:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1158:402:0;;;;;;;;;;;;;;;;;;;566:167:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;566:167:6;;;;;;;;;;;;;;;;;;;770:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2171:222:2:-;2254:4;2306:6;2274:7;:19;2282:10;2274:19;;;;;;;;;;;;;;;:29;2294:8;2274:29;;;;;;;;;;;;;;;:38;;;;2348:8;2327:38;;2336:10;2327:38;;;2358:6;2327:38;;;;;;;;;;;;;;;2382:4;2375:11;;2171:222;;;;:::o;1073:26::-;;;;:::o;1108:697:4:-;1206:4;1226:17;1246:7;:14;1254:5;1246:14;;;;;;;;;;;;;;;:26;1261:10;1246:26;;;;;;;;;;;;;;;;1226:46;;1322:6;1303:8;:15;1312:5;1303:15;;;;;;;;;;;;;;;;:25;;1342:20;;;;;;;;;;;;;;;;;;;;;;;1282:90;;;;;;;;;;;;;;;;;;;;;;;;;;;1416:6;1403:9;:19;;1436:22;;;;;;;;;;;;;;;;;;;;;;;1382:86;;;;;;;;;;;;;;;;;;;;;;;;;;;1525:8;:13;1534:3;1525:13;;;;;;;;;;;;;;;;1515:6;1499:8;:13;1508:3;1499:13;;;;;;;;;;;;;;;;:22;:39;;1552:8;;;;;;;;;;;;;;;;;;;;;;;1478:92;;;;;;;;;;;;;;;;;;;;;;;;;;;1597:6;1580:8;:13;1589:3;1580:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1632:6;1613:8;:15;1622:5;1613:15;;;;;;;;;;;;;;;;:25;;;;;;;;;;;762:10;1652:9;:20;1648:87;;;1718:6;1688:7;:14;1696:5;1688:14;;;;;;;;;;;;;;;:26;1703:10;1688:26;;;;;;;;;;;;;;;;:36;;;;;;;;;;;1648:87;1765:3;1749:28;;1758:5;1749:28;;;1770:6;1749:28;;;;;;;;;;;;;;;1794:4;1787:11;;1108:697;;;;;;:::o;820:23:0:-;;;;:::o;2399:125:2:-;2471:7;2501:8;:16;2510:6;2501:16;;;;;;;;;;;;;;;;2494:23;;2399:125;;;:::o;292:20:6:-;;;;;;;;;;;;;:::o;794::0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;905:321:1:-;995:21;985:6;:31;;964:133;;;;;;;;;;;;;;;;;;;;;;;;1130:37;1138:6;1146:8;:20;1155:10;1146:20;;;;;;;;;;;;;;;;1130:7;:37::i;:::-;1107:8;:20;1116:10;1107:20;;;;;;;;;;;;;;;:60;;;;1191:28;1199:11;;1212:6;1191:7;:28::i;:::-;1177:11;:42;;;;905:321;:::o;1106:445:2:-;1185:4;1250:6;1226:8;:20;1235:10;1226:20;;;;;;;;;;;;;;;;:30;;1270:20;;;;;;;;;;;;;;;;;;;;;;;1205:95;;;;;;;;;;;;;;;;;;;;;;;;;;;1357:8;:13;1366:3;1357:13;;;;;;;;;;;;;;;;1347:6;1331:8;:13;1340:3;1331:13;;;;;;;;;;;;;;;;:22;:39;;1384:8;;;;;;;;;;;;;;;;;;;;;;;1310:92;;;;;;;;;;;;;;;;;;;;;;;;;;;1436:6;1412:8;:20;1421:10;1412:20;;;;;;;;;;;;;;;;:30;;;;;;;;;;;1469:6;1452:8;:13;1461:3;1452:13;;;;;;;;;;;;;;;;:23;;;;;;;;;;;1511:3;1490:33;;1499:10;1490:33;;;1516:6;1490:33;;;;;;;;;;;;;;;1540:4;1533:11;;1106:445;;;;:::o;2530:160::-;2628:7;2658;:15;2666:6;2658:15;;;;;;;;;;;;;;;:25;2674:8;2658:25;;;;;;;;;;;;;;;;2651:32;;2530:160;;;;:::o;1158:402:0:-;1258:19;460:5:6;;;;;;;;;;;446:19;;:10;:19;;;425:117;;;;;;;;;;;;;;;;;;;;;;;;1280:18:0;1290:7;1280:9;:18::i;:::-;1258:40;;1321:11;1312:6;:20;1308:210;;;1362:50;1370:11;;1383:28;1391:11;1404:6;1383:7;:28::i;:::-;1362:7;:50::i;:::-;1348:11;:64;;;;1308:210;;;1457:50;1465:11;;1478:28;1486:6;1494:11;1478:7;:28::i;:::-;1457:7;:50::i;:::-;1443:11;:64;;;;1308:210;1547:6;1527:8;:17;1536:7;1527:17;;;;;;;;;;;;;;;:26;;;;1158:402;;;:::o;566:167:6:-;460:5;;;;;;;;;;;446:19;;:10;:19;;;425:117;;;;;;;;;;;;;;;;;;;;;;;;682:1;662:22;;:8;:22;;;;658:69;;;708:8;700:5;;:16;;;;;;;;;;;;;;;;;;658:69;566:167;:::o;570:166:7:-;650:7;673:6;686:1;682;:5;673:14;;709:1;704;:6;;697:14;;;;;;728:1;721:8;;570:166;;;;;:::o;418:146::-;498:7;533:1;528;:6;;521:14;;;;;;556:1;552;:5;545:12;;418:146;;;;:::o;5:118:-1:-;;72:46;110:6;97:20;72:46;;;63:55;;57:66;;;;;130:118;;197:46;235:6;222:20;197:46;;;188:55;;182:66;;;;;255:241;;359:2;347:9;338:7;334:23;330:32;327:2;;;375:1;372;365:12;327:2;410:1;427:53;472:7;463:6;452:9;448:22;427:53;;;417:63;;389:97;321:175;;;;;503:366;;;624:2;612:9;603:7;599:23;595:32;592:2;;;640:1;637;630:12;592:2;675:1;692:53;737:7;728:6;717:9;713:22;692:53;;;682:63;;654:97;782:2;800:53;845:7;836:6;825:9;821:22;800:53;;;790:63;;761:98;586:283;;;;;;876:491;;;;1014:2;1002:9;993:7;989:23;985:32;982:2;;;1030:1;1027;1020:12;982:2;1065:1;1082:53;1127:7;1118:6;1107:9;1103:22;1082:53;;;1072:63;;1044:97;1172:2;1190:53;1235:7;1226:6;1215:9;1211:22;1190:53;;;1180:63;;1151:98;1280:2;1298:53;1343:7;1334:6;1323:9;1319:22;1298:53;;;1288:63;;1259:98;976:391;;;;;;1374:366;;;1495:2;1483:9;1474:7;1470:23;1466:32;1463:2;;;1511:1;1508;1501:12;1463:2;1546:1;1563:53;1608:7;1599:6;1588:9;1584:22;1563:53;;;1553:63;;1525:97;1653:2;1671:53;1716:7;1707:6;1696:9;1692:22;1671:53;;;1661:63;;1632:98;1457:283;;;;;;1747:241;;1851:2;1839:9;1830:7;1826:23;1822:32;1819:2;;;1867:1;1864;1857:12;1819:2;1902:1;1919:53;1964:7;1955:6;1944:9;1940:22;1919:53;;;1909:63;;1881:97;1813:175;;;;;1995:110;2068:31;2093:5;2068:31;;;2063:3;2056:44;2050:55;;;2112:101;2179:28;2201:5;2179:28;;;2174:3;2167:41;2161:52;;;2220:292;;2318:35;2347:5;2318:35;;;2370:6;2365:3;2358:19;2382:63;2438:6;2431:4;2426:3;2422:14;2415:4;2408:5;2404:16;2382:63;;;2477:29;2499:6;2477:29;;;2470:4;2465:3;2461:14;2457:50;2450:57;;2298:214;;;;;;2520:397;;2675:2;2670:3;2663:15;2712:66;2707:2;2702:3;2698:12;2691:88;2813:66;2808:2;2803:3;2799:12;2792:88;2908:2;2903:3;2899:12;2892:19;;2656:261;;;;2926:397;;3081:2;3076:3;3069:15;3118:66;3113:2;3108:3;3104:12;3097:88;3219:66;3214:2;3209:3;3205:12;3198:88;3314:2;3309:3;3305:12;3298:19;;3062:261;;;;3331:110;3404:31;3429:5;3404:31;;;3399:3;3392:44;3386:55;;;3448:193;;3556:2;3545:9;3541:18;3533:26;;3570:61;3628:1;3617:9;3613:17;3604:6;3570:61;;;3527:114;;;;;3648:181;;3750:2;3739:9;3735:18;3727:26;;3764:55;3816:1;3805:9;3801:17;3792:6;3764:55;;;3721:108;;;;;3836:273;;3960:2;3949:9;3945:18;3937:26;;4010:9;4004:4;4000:20;3996:1;3985:9;3981:17;3974:47;4035:64;4094:4;4085:6;4035:64;;;4027:72;;3931:178;;;;;4116:387;;4297:2;4286:9;4282:18;4274:26;;4347:9;4341:4;4337:20;4333:1;4322:9;4318:17;4311:47;4372:121;4488:4;4372:121;;;4364:129;;4268:235;;;;4510:387;;4691:2;4680:9;4676:18;4668:26;;4741:9;4735:4;4731:20;4727:1;4716:9;4712:17;4705:47;4766:121;4882:4;4766:121;;;4758:129;;4662:235;;;;4904:193;;5012:2;5001:9;4997:18;4989:26;;5026:61;5084:1;5073:9;5069:17;5060:6;5026:61;;;4983:114;;;;;5104:88;;5181:5;5175:12;5165:22;;5159:33;;;;5199:128;;5279:42;5272:5;5268:54;5257:65;;5251:76;;;;5334:92;;5414:5;5407:13;5400:21;5389:32;;5383:43;;;;5433:79;;5502:5;5491:16;;5485:27;;;;5519:128;;5599:42;5592:5;5588:54;5577:65;;5571:76;;;;5654:79;;5723:5;5712:16;;5706:27;;;;5741:268;5806:1;5813:101;5827:6;5824:1;5821:13;5813:101;;;5903:1;5898:3;5894:11;5888:18;5884:1;5879:3;5875:11;5868:39;5849:2;5846:1;5842:10;5837:15;;5813:101;;;5929:6;5926:1;5923:13;5920:2;;;5994:1;5985:6;5980:3;5976:16;5969:27;5920:2;5790:219;;;;;6017:97;;6105:2;6101:7;6096:2;6089:5;6085:14;6081:28;6071:38;;6065:49;;;" } } @@ -344,19 +344,19 @@ } }, "sourceCodes": { - "current/test/DummyERC20Token/DummyERC20Token.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"../Mintable/Mintable.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\ncontract DummyERC20Token is Mintable, Ownable {\n string public name;\n string public symbol;\n uint256 public decimals;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply)\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n function setBalance(address _target, uint256 _value)\n public\n onlyOwner\n {\n uint256 currBalance = balanceOf(_target);\n if (_value < currBalance) {\n totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));\n } else {\n totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n}\n", - "current/test/Mintable/Mintable.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n/*\n * Mintable\n * Base contract that creates a mintable UnlimitedAllowanceToken\n */\ncontract Mintable is UnlimitedAllowanceToken, SafeMath {\n function mint(uint256 _value)\n public\n {\n require(\n _value <= 100000000000000000000,\n \"Minting more than 100000000000000000000 is not allowed.\"\n );\n balances[msg.sender] = safeAdd(_value, balances[msg.sender]);\n totalSupply = safeAdd(totalSupply, _value);\n }\n}\n", - "current/tokens/ERC20Token/ERC20Token.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"./IERC20Token.sol\";\n\ncontract ERC20Token is IERC20Token {\n\n string constant INSUFFICIENT_BALANCE = \"Insufficient balance to complete transfer.\";\n string constant INSUFFICIENT_ALLOWANCE = \"Insufficient allowance to complete transfer.\";\n string constant OVERFLOW = \"Transfer would result in an overflow.\";\n\n mapping (address => uint256) balances;\n mapping (address => mapping (address => uint256)) allowed;\n\n uint256 public totalSupply;\n\n function transfer(address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n emit Transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowed[_from][msg.sender] >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function approve(address _spender, uint256 _value)\n public\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function balanceOf(address _owner)\n public view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n function allowance(address _owner, address _spender)\n public\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n\n", - "current/tokens/ERC20Token/IERC20Token.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.4.23;\npragma experimental ABIEncoderV2;\n\ncontract IERC20Token {\n\n /// @notice send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint256 _value)\n public\n returns (bool);\n\n /// @notice send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool);\n \n /// @notice `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint256 _value)\n public\n returns (bool);\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner)\n public view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n public view\n returns (uint256);\n\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n \n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n}\n", - "current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.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.4.23;\npragma experimental ABIEncoderV2;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\ncontract UnlimitedAllowanceToken is ERC20Token {\n\n uint256 constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowance >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n emit Transfer(_from, _to, _value);\n return true;\n }\n}\n", - "current/utils/Ownable/IOwnable.sol": "pragma solidity ^0.4.23;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n", - "current/utils/Ownable/Ownable.sol": "pragma solidity ^0.4.23;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only contract owner is allowed to call this method.\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n", - "current/utils/SafeMath/SafeMath.sol": "pragma solidity ^0.4.23;\npragma experimental ABIEncoderV2;\n\ncontract SafeMath {\n function safeMul(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a * b;\n assert(a == 0 || c / a == b);\n return c;\n }\n\n function safeDiv(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a / b;\n return c;\n }\n\n function safeSub(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n assert(b <= a);\n return a - b;\n }\n\n function safeAdd(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a + b;\n assert(c >= a);\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n" + "current/test/DummyERC20Token/DummyERC20Token.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../Mintable/Mintable.sol\";\nimport \"../../utils/Ownable/Ownable.sol\";\n\ncontract DummyERC20Token is Mintable, Ownable {\n string public name;\n string public symbol;\n uint256 public decimals;\n\n constructor (\n string _name,\n string _symbol,\n uint256 _decimals,\n uint256 _totalSupply)\n public\n {\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n totalSupply = _totalSupply;\n balances[msg.sender] = _totalSupply;\n }\n\n function setBalance(address _target, uint256 _value)\n public\n onlyOwner\n {\n uint256 currBalance = balanceOf(_target);\n if (_value < currBalance) {\n totalSupply = safeSub(totalSupply, safeSub(currBalance, _value));\n } else {\n totalSupply = safeAdd(totalSupply, safeSub(_value, currBalance));\n }\n balances[_target] = _value;\n }\n}\n", + "current/test/Mintable/Mintable.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol\";\nimport \"../../utils/SafeMath/SafeMath.sol\";\n\n/*\n * Mintable\n * Base contract that creates a mintable UnlimitedAllowanceToken\n */\ncontract Mintable is UnlimitedAllowanceToken, SafeMath {\n function mint(uint256 _value)\n public\n {\n require(\n _value <= 100000000000000000000,\n \"Minting more than 100000000000000000000 is not allowed.\"\n );\n balances[msg.sender] = safeAdd(_value, balances[msg.sender]);\n totalSupply = safeAdd(totalSupply, _value);\n }\n}\n", + "current/tokens/ERC20Token/ERC20Token.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"./IERC20Token.sol\";\n\ncontract ERC20Token is IERC20Token {\n\n string constant INSUFFICIENT_BALANCE = \"Insufficient balance to complete transfer.\";\n string constant INSUFFICIENT_ALLOWANCE = \"Insufficient allowance to complete transfer.\";\n string constant OVERFLOW = \"Transfer would result in an overflow.\";\n\n mapping (address => uint256) balances;\n mapping (address => mapping (address => uint256)) allowed;\n\n uint256 public totalSupply;\n\n function transfer(address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[msg.sender] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[msg.sender] -= _value;\n balances[_to] += _value;\n emit Transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowed[_from][msg.sender] >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n allowed[_from][msg.sender] -= _value;\n emit Transfer(_from, _to, _value);\n return true;\n }\n\n function approve(address _spender, uint256 _value)\n public\n returns (bool)\n {\n allowed[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n function balanceOf(address _owner)\n public view\n returns (uint256)\n {\n return balances[_owner];\n }\n\n function allowance(address _owner, address _spender)\n public\n view\n returns (uint256)\n {\n return allowed[_owner][_spender];\n }\n}\n\n", + "current/tokens/ERC20Token/IERC20Token.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.4.24;\npragma experimental ABIEncoderV2;\n\ncontract IERC20Token {\n\n /// @notice send `value` token to `to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint256 _value)\n public\n returns (bool);\n\n /// @notice send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param _from The address of the sender\n /// @param _to The address of the recipient\n /// @param _value The amount of token to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool);\n \n /// @notice `msg.sender` approves `_spender` to spend `_value` tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _value The amount of wei to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint256 _value)\n public\n returns (bool);\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner)\n public view\n returns (uint256);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address _owner, address _spender)\n public view\n returns (uint256);\n\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 _value\n );\n \n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _value\n );\n}\n", + "current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.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.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../ERC20Token/ERC20Token.sol\";\n\ncontract UnlimitedAllowanceToken is ERC20Token {\n\n uint256 constant MAX_UINT = 2**256 - 1;\n\n /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717\n /// @param _from Address to transfer from.\n /// @param _to Address to transfer to.\n /// @param _value Amount to transfer.\n /// @return Success of transfer.\n function transferFrom(address _from, address _to, uint256 _value)\n public\n returns (bool)\n {\n uint256 allowance = allowed[_from][msg.sender];\n require(\n balances[_from] >= _value,\n INSUFFICIENT_BALANCE\n );\n require(\n allowance >= _value,\n INSUFFICIENT_ALLOWANCE\n );\n require(\n balances[_to] + _value >= balances[_to],\n OVERFLOW\n );\n balances[_to] += _value;\n balances[_from] -= _value;\n if (allowance < MAX_UINT) {\n allowed[_from][msg.sender] -= _value;\n }\n emit Transfer(_from, _to, _value);\n return true;\n }\n}\n", + "current/utils/Ownable/IOwnable.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\ncontract IOwnable {\n function transferOwnership(address newOwner)\n public;\n}\n", + "current/utils/Ownable/Ownable.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\n/*\n * Ownable\n *\n * Base contract with an owner.\n * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.\n */\n\nimport \"./IOwnable.sol\";\n\ncontract Ownable is IOwnable {\n address public owner;\n\n constructor ()\n public\n {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(\n msg.sender == owner,\n \"Only contract owner is allowed to call this method.\"\n );\n _;\n }\n\n function transferOwnership(address newOwner)\n public\n onlyOwner\n {\n if (newOwner != address(0)) {\n owner = newOwner;\n }\n }\n}\n", + "current/utils/SafeMath/SafeMath.sol": "pragma solidity ^0.4.24;\npragma experimental ABIEncoderV2;\n\ncontract SafeMath {\n function safeMul(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a * b;\n assert(a == 0 || c / a == b);\n return c;\n }\n\n function safeDiv(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a / b;\n return c;\n }\n\n function safeSub(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n assert(b <= a);\n return a - b;\n }\n\n function safeAdd(uint a, uint b)\n internal\n pure\n returns (uint256)\n {\n uint c = a + b;\n assert(c >= a);\n return c;\n }\n\n function max64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min64(uint64 a, uint64 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n}\n" }, - "sourceTreeHashHex": "0x72097ec50fe2cc41973383063c508ca0864d63f9cd33cd7f21e29639c07efa15", + "sourceTreeHashHex": "0x4830433daa189b8c48beea455c8f20379bb7b5a33b1607b73e3938501a24bd2b", "compiler": { "name": "solc", - "version": "0.4.23", + "version": "0.4.24", "settings": { "outputSelection": { "*": { -- cgit v1.2.3 From 09e59cf67761e86046221d058a9632730a5a632a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:23:14 -0700 Subject: Fix the tsutils version, fixing ts typings issue --- packages/tslint-config/package.json | 2 +- yarn.lock | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 75cf03b05..799f716f3 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -46,7 +46,7 @@ "tslint": "5.8.0", "tslint-eslint-rules": "^4.1.1", "tslint-react": "^3.2.0", - "tsutils": "^2.12.1" + "tsutils": "2.22.2" }, "publishConfig": { "access": "public" diff --git a/yarn.lock b/yarn.lock index 6f1b7b931..da943da75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11482,6 +11482,12 @@ tslint@^5.9.1: tslib "^1.8.0" tsutils "^2.12.1" +tsutils@2.22.2: + version "2.22.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.22.2.tgz#0b9f3d87aa3eb95bd32d26ce2b88aa329a657951" + dependencies: + tslib "^1.8.1" + tsutils@^1.4.0: version "1.9.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" -- cgit v1.2.3 From 61fa34e2ce9481333c0632dabdaf03582c71a78a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:42:52 -0700 Subject: Fix tslint --- packages/website/ts/components/portal/menu.tsx | 4 ++-- packages/website/ts/components/portal/portal.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/website/ts/components/portal/menu.tsx b/packages/website/ts/components/portal/menu.tsx index e8353a3b0..6a3301549 100644 --- a/packages/website/ts/components/portal/menu.tsx +++ b/packages/website/ts/components/portal/menu.tsx @@ -61,13 +61,13 @@ export const Menu: React.StatelessComponent = (props: MenuProps) => { return (
{_.map(props.menuItemEntries, entry => { - const selected = entry.to === props.selectedPath; + const isSelected = entry.to === props.selectedPath; return ( diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index b992204a7..1bd318c28 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -466,8 +466,8 @@ export class Portal extends React.Component { this.props.dispatcher.updateScreenWidth(newScreenWidth); } private _isSmallScreen(): boolean { - const result = this.props.screenWidth === ScreenWidths.Sm; - return result; + const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm; + return isSmallScreen; } } -- cgit v1.2.3 From 15c199d5a23bcab229a4eab531c5ecc49e9f718b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:58:35 -0700 Subject: Add `are` to boolean naming conventions --- packages/tslint-config/rules/booleanNamingRule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tslint-config/rules/booleanNamingRule.ts b/packages/tslint-config/rules/booleanNamingRule.ts index f673afc6a..a8e1dc390 100644 --- a/packages/tslint-config/rules/booleanNamingRule.ts +++ b/packages/tslint-config/rules/booleanNamingRule.ts @@ -2,7 +2,7 @@ import * as _ from 'lodash'; import * as Lint from 'tslint'; import * as ts from 'typescript'; -const VALID_BOOLEAN_PREFIXES = ['is', 'does', 'should', 'was', 'has', 'can', 'did', 'would']; +const VALID_BOOLEAN_PREFIXES = ['is', 'does', 'should', 'was', 'has', 'can', 'did', 'would', 'are']; export class Rule extends Lint.Rules.TypedRule { public static FAILURE_STRING = `Boolean variable names should begin with: ${VALID_BOOLEAN_PREFIXES.join(', ')}`; -- cgit v1.2.3 From 9373451ca8c19ac2ab20db792fd049ccf284f1f2 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 11:58:42 -0700 Subject: Fix tslint issues --- packages/contracts/test/exchange/signature_validator.ts | 8 ++++---- packages/contracts/test/utils/match_order_tester.ts | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index 489ed32c5..edff3abc6 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -62,12 +62,12 @@ describe('MixinSignatureValidator', () => { it('should return true with a valid signature', async () => { const orderHashHex = orderUtils.getOrderHashHex(signedOrder); - const success = await signatureValidator.publicIsValidSignature.callAsync( + const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync( orderHashHex, signedOrder.makerAddress, signedOrder.signature, ); - expect(success).to.be.true(); + expect(isValidSignature).to.be.true(); }); it('should return false with an invalid signature', async () => { @@ -81,12 +81,12 @@ describe('MixinSignatureValidator', () => { const invalidSigHex = `0x${invalidSigBuff.toString('hex')}`; signedOrder.signature = invalidSigHex; const orderHashHex = orderUtils.getOrderHashHex(signedOrder); - const success = await signatureValidator.publicIsValidSignature.callAsync( + const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync( orderHashHex, signedOrder.makerAddress, signedOrder.signature, ); - expect(success).to.be.false(); + expect(isValidSignature).to.be.false(); }); }); }); diff --git a/packages/contracts/test/utils/match_order_tester.ts b/packages/contracts/test/utils/match_order_tester.ts index da311e6ea..ae874e502 100644 --- a/packages/contracts/test/utils/match_order_tester.ts +++ b/packages/contracts/test/utils/match_order_tester.ts @@ -57,8 +57,8 @@ export class MatchOrderTester { realERC721TokenIdsByOwner: ERC721TokenIdsByOwner, ): boolean { // ERC20 Balances - const erc20BalancesMatch = _.isEqual(expectedNewERC20BalancesByOwner, realERC20BalancesByOwner); - if (!erc20BalancesMatch) { + const doesErc20BalancesMatch = _.isEqual(expectedNewERC20BalancesByOwner, realERC20BalancesByOwner); + if (!doesErc20BalancesMatch) { return false; } // ERC721 Token Ids @@ -75,8 +75,11 @@ export class MatchOrderTester { _.sortBy(tokenIds); }); }); - const erc721TokenIdsMatch = _.isEqual(sortedExpectedNewERC721TokenIdsByOwner, sortedNewERC721TokenIdsByOwner); - return erc721TokenIdsMatch; + const doesErc721TokenIdsMatch = _.isEqual( + sortedExpectedNewERC721TokenIdsByOwner, + sortedNewERC721TokenIdsByOwner, + ); + return doesErc721TokenIdsMatch; } /// @dev Constructs new MatchOrderTester. /// @param exchangeWrapper Used to call to the Exchange. @@ -156,13 +159,13 @@ export class MatchOrderTester { expectedTransferAmounts, ); // Assert our expected balances are equal to the actual balances - const expectedBalancesMatchRealBalances = MatchOrderTester._compareExpectedAndRealBalances( + const didExpectedBalancesMatchRealBalances = MatchOrderTester._compareExpectedAndRealBalances( expectedERC20BalancesByOwner, newERC20BalancesByOwner, expectedERC721TokenIdsByOwner, newERC721TokenIdsByOwner, ); - expect(expectedBalancesMatchRealBalances).to.be.true(); + expect(didExpectedBalancesMatchRealBalances).to.be.true(); return [newERC20BalancesByOwner, newERC721TokenIdsByOwner]; } /// @dev Calculates expected transfer amounts between order makers, fee recipients, and -- cgit v1.2.3 From 09d80b1e503b00483f32c60745a61ca8e4477be9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 13:14:38 -0700 Subject: Fix imports --- packages/contracts/src/utils/constants.ts | 2 +- packages/contracts/test/ether_token.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts index 41968f547..483340186 100644 --- a/packages/contracts/src/utils/constants.ts +++ b/packages/contracts/src/utils/constants.ts @@ -1,5 +1,5 @@ import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3_wrapper'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 4c85147df..8f2a01a4d 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -2,7 +2,6 @@ import { ContractWrappersError } from '@0xproject/contract-wrappers'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber, promisify } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import { Web3Wrapper } from '@0xproject/web3_wrapper'; import * as chai from 'chai'; import 'make-promises-safe'; -- cgit v1.2.3 From 9de9bf651b7cede14ed718a438c48204dec5f989 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 13:15:01 -0700 Subject: Fix ExchangeWrapper --- packages/contracts/src/utils/exchange_wrapper.ts | 8 +++++--- packages/contracts/test/exchange/core.ts | 8 +------- packages/contracts/test/exchange/match_orders.ts | 2 +- packages/contracts/test/exchange/transactions.ts | 2 +- packages/contracts/test/exchange/wrapper.ts | 2 +- packages/contracts/test/tutorials/arbitrage.ts | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index 17445ff75..0d0977ab8 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -1,4 +1,4 @@ -import { TransactionReceiptWithDecodedLogs } from '@0xproject/types'; +import { Provider, TransactionReceiptWithDecodedLogs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -14,9 +14,11 @@ import { AssetProxyId, OrderInfo, SignedOrder, SignedTransaction } from './types export class ExchangeWrapper { private _exchange: ExchangeContract; + private _web3Wrapper: Web3Wrapper; private _logDecoder: LogDecoder = new LogDecoder(constants.TESTRPC_NETWORK_ID); - constructor(exchangeContract: ExchangeContract) { + constructor(exchangeContract: ExchangeContract, provider: Provider) { this._exchange = exchangeContract; + this._web3Wrapper = new Web3Wrapper(provider); } public async fillOrderAsync( signedOrder: SignedOrder, @@ -245,7 +247,7 @@ export class ExchangeWrapper { return tx; } private async _getTxWithDecodedExchangeLogsAsync(txHash: string): Promise { - const tx = await Web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const tx = await this._web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address); tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log)); return tx; diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index a54ec7692..5a91f42d1 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -60,8 +60,6 @@ describe('Exchange core', () => { let defaultMakerAssetAddress: string; let defaultTakerAssetAddress: string; - let zeroEx: ZeroEx; - before(async () => { await blockchainLifecycle.startAsync(); }); @@ -92,11 +90,7 @@ describe('Exchange core', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - zeroEx = new ZeroEx(provider, { - exchangeContractAddress: exchange.address, - networkId: constants.TESTRPC_NETWORK_ID, - }); - exchangeWrapper = new ExchangeWrapper(exchange); + exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index 9f8f6db44..e732c90db 100644 --- a/packages/contracts/test/exchange/match_orders.ts +++ b/packages/contracts/test/exchange/match_orders.ts @@ -116,7 +116,7 @@ describe('matchOrders', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - exchangeWrapper = new ExchangeWrapper(exchange); + exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); // Authorize ERC20 and ERC721 trades by exchange diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index 42e2429bb..203c05e53 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -79,7 +79,7 @@ describe('Exchange transactions', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - exchangeWrapper = new ExchangeWrapper(exchange); + exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await web3Wrapper.awaitTransactionMinedAsync( diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 99f23a5db..39f861968 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -83,7 +83,7 @@ describe('Exchange wrappers', () => { txDefaults, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ); - exchangeWrapper = new ExchangeWrapper(exchange); + exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); diff --git a/packages/contracts/test/tutorials/arbitrage.ts b/packages/contracts/test/tutorials/arbitrage.ts index 1a53871cd..e5787d5b8 100644 --- a/packages/contracts/test/tutorials/arbitrage.ts +++ b/packages/contracts/test/tutorials/arbitrage.ts @@ -115,7 +115,7 @@ // exchangeContractAddress: exchange.address, // networkId: constants.TESTRPC_NETWORK_ID, // }); -// exWrapper = new ExchangeWrapper(exchange); +// exWrapper = new ExchangeWrapper(exchange, provider); // makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(1), 18); // takerTokenAmount = makerTokenAmount; -- cgit v1.2.3 From 5a09063adbb3fe506496b3413926d550575a85a5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 13:15:16 -0700 Subject: Refactor etherToken test to use contract-wrappers --- packages/contracts/test/ether_token.ts | 58 +++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 8f2a01a4d..90538caf9 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -1,4 +1,4 @@ -import { ContractWrappersError } from '@0xproject/contract-wrappers'; +import { ContractWrappers, ContractWrappersError } from '@0xproject/contract-wrappers'; import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; import { BigNumber, promisify } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -18,7 +18,7 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('EtherToken', () => { let account: string; const gasPrice = Web3Wrapper.toBaseUnitAmount(new BigNumber(20), 9); - let zeroEx: ZeroEx; + let contractWrappers: ContractWrappers; let etherTokenAddress: string; before(async () => { @@ -33,7 +33,7 @@ describe('EtherToken', () => { const etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.EtherToken, provider, txDefaults); etherTokenAddress = etherToken.address; - zeroEx = new ZeroEx(provider, { + contractWrappers = new ContractWrappers(provider, { gasPrice, networkId: constants.TESTRPC_NETWORK_ID, }); @@ -49,23 +49,26 @@ describe('EtherToken', () => { const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); const ethToDeposit = initEthBalance.plus(1); - return expect(zeroEx.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account)).to.be.rejectedWith( - ContractWrappersError.InsufficientEthBalanceForDeposit, - ); + return expect( + contractWrappers.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account), + ).to.be.rejectedWith(ContractWrappersError.InsufficientEthBalanceForDeposit); }); it('should convert deposited Ether to wrapped Ether tokens', async () => { const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); - const initEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + const initEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); const ethToDeposit = new BigNumber(Web3Wrapper.toWei(new BigNumber(1))); - const txHash = await zeroEx.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account); - const receipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const txHash = await contractWrappers.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account); + const receipt = await contractWrappers.awaitTransactionMinedAsync( + txHash, + constants.AWAIT_TRANSACTION_MINED_MS, + ); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); - const finalEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + const finalEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); expect(finalEthBalance).to.be.bignumber.equal(initEthBalance.minus(ethToDeposit.plus(ethSpentOnGas))); expect(finalEthTokenBalance).to.be.bignumber.equal(initEthTokenBalance.plus(ethToDeposit)); @@ -74,29 +77,37 @@ describe('EtherToken', () => { describe('withdraw', () => { it('should throw if caller attempts to withdraw greater than caller balance', async () => { - const initEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + const initEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); const ethTokensToWithdraw = initEthTokenBalance.plus(1); return expect( - zeroEx.etherToken.withdrawAsync(etherTokenAddress, ethTokensToWithdraw, account), + contractWrappers.etherToken.withdrawAsync(etherTokenAddress, ethTokensToWithdraw, account), ).to.be.rejectedWith(ContractWrappersError.InsufficientWEthBalanceForWithdrawal); }); it('should convert ether tokens to ether with sufficient balance', async () => { const ethToDeposit = new BigNumber(Web3Wrapper.toWei(new BigNumber(1))); - await zeroEx.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account); - const initEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + await contractWrappers.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account); + const initEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); const ethTokensToWithdraw = initEthTokenBalance; expect(ethTokensToWithdraw).to.not.be.bignumber.equal(0); - const txHash = await zeroEx.etherToken.withdrawAsync(etherTokenAddress, ethTokensToWithdraw, account, { - gasLimit: constants.MAX_ETHERTOKEN_WITHDRAW_GAS, - }); - const receipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const txHash = await contractWrappers.etherToken.withdrawAsync( + etherTokenAddress, + ethTokensToWithdraw, + account, + { + gasLimit: constants.MAX_ETHERTOKEN_WITHDRAW_GAS, + }, + ); + const receipt = await contractWrappers.awaitTransactionMinedAsync( + txHash, + constants.AWAIT_TRANSACTION_MINED_MS, + ); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); - const finalEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + const finalEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); expect(finalEthBalance).to.be.bignumber.equal( initEthBalance.plus(ethTokensToWithdraw.minus(ethSpentOnGas)), @@ -108,7 +119,7 @@ describe('EtherToken', () => { describe('fallback', () => { it('should convert sent ether to ether tokens', async () => { const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); - const initEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + const initEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); const ethToDeposit = Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18); @@ -119,11 +130,14 @@ describe('EtherToken', () => { gasPrice, }); - const receipt = await zeroEx.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + const receipt = await contractWrappers.awaitTransactionMinedAsync( + txHash, + constants.AWAIT_TRANSACTION_MINED_MS, + ); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); - const finalEthTokenBalance = await zeroEx.token.getBalanceAsync(etherTokenAddress, account); + const finalEthTokenBalance = await contractWrappers.token.getBalanceAsync(etherTokenAddress, account); expect(finalEthBalance).to.be.bignumber.equal(initEthBalance.minus(ethToDeposit.plus(ethSpentOnGas))); expect(finalEthTokenBalance).to.be.bignumber.equal(initEthTokenBalance.plus(ethToDeposit)); -- cgit v1.2.3 From c8dad01137ac718de721941ba86c1cc2075e2c5f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 13:19:29 -0700 Subject: Fix await calls --- packages/contracts/test/ether_token.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index 90538caf9..9b04dd187 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -61,10 +61,7 @@ describe('EtherToken', () => { const ethToDeposit = new BigNumber(Web3Wrapper.toWei(new BigNumber(1))); const txHash = await contractWrappers.etherToken.depositAsync(etherTokenAddress, ethToDeposit, account); - const receipt = await contractWrappers.awaitTransactionMinedAsync( - txHash, - constants.AWAIT_TRANSACTION_MINED_MS, - ); + const receipt = await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); @@ -100,10 +97,7 @@ describe('EtherToken', () => { gasLimit: constants.MAX_ETHERTOKEN_WITHDRAW_GAS, }, ); - const receipt = await contractWrappers.awaitTransactionMinedAsync( - txHash, - constants.AWAIT_TRANSACTION_MINED_MS, - ); + const receipt = await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); @@ -130,10 +124,7 @@ describe('EtherToken', () => { gasPrice, }); - const receipt = await contractWrappers.awaitTransactionMinedAsync( - txHash, - constants.AWAIT_TRANSACTION_MINED_MS, - ); + const receipt = await web3Wrapper.awaitTransactionMinedAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ethSpentOnGas = gasPrice.times(receipt.gasUsed); const finalEthBalance = await web3Wrapper.getBalanceInWeiAsync(account); -- cgit v1.2.3 From 4897513d7d4b25c671be81a81615f78cfcd30173 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 13:19:35 -0700 Subject: Fix import --- packages/contracts/test/exchange/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 5a91f42d1..78b36dfc3 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -1,7 +1,7 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { LogWithDecodedArgs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web-wrapper'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import ethUtil = require('ethereumjs-util'); import 'make-promises-safe'; -- cgit v1.2.3 From 6f57f52ac209e00cb9582a874dfd3bac5b295a4e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 13:44:35 -0700 Subject: Fix dep version --- packages/contracts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/package.json b/packages/contracts/package.json index b19f0cd50..a9a1c8396 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -64,7 +64,7 @@ }, "dependencies": { "@0xproject/base-contract": "^0.3.1", - "@0xproject/contract-wrappers": "^0.0.2", + "@0xproject/contract-wrappers": "^0.0.1", "@0xproject/order-utils": "^0.0.4", "@0xproject/sol-compiler": "^0.4.3", "@0xproject/types": "^0.6.3", -- cgit v1.2.3 From ae220c37dff04c8d4d22e48865a5a268000c2f12 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 9 May 2018 23:05:20 +0200 Subject: Add solcVersion to CompilerOpts --- packages/sol-compiler/src/compiler.ts | 13 +++++++++---- packages/sol-compiler/src/index.ts | 1 + packages/sol-compiler/src/utils/types.ts | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index c17616246..2ebc5228e 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -74,6 +74,7 @@ export class Compiler { private _contractsDir: string; private _compilerSettings: solc.CompilerSettings; private _artifactsDir: string; + private _solcVersionIfExists: string | undefined; private _specifiedContracts: string[] | TYPE_ALL_FILES_IDENTIFIER; /** * Instantiates a new instance of the Compiler class. @@ -85,6 +86,7 @@ export class Compiler { ? JSON.parse(fs.readFileSync(CONFIG_FILE).toString()) : {}; this._contractsDir = opts.contractsDir || config.contractsDir || DEFAULT_CONTRACTS_DIR; + this._solcVersionIfExists = opts.solcVersion || config.solcVersion; this._compilerSettings = opts.compilerSettings || config.compilerSettings || DEFAULT_COMPILER_SETTINGS; this._artifactsDir = opts.artifactsDir || config.artifactsDir || DEFAULT_ARTIFACTS_DIR; this._specifiedContracts = opts.contracts || config.contracts || ALL_CONTRACTS_IDENTIFIER; @@ -139,9 +141,12 @@ export class Compiler { if (!shouldCompile) { return; } - const solcVersionRange = parseSolidityVersionRange(contractSource.source); - const availableCompilerVersions = _.keys(binPaths); - const solcVersion = semver.maxSatisfying(availableCompilerVersions, solcVersionRange); + let solcVersion = this._solcVersionIfExists; + if (_.isUndefined(solcVersion)) { + const solcVersionRange = parseSolidityVersionRange(contractSource.source); + const availableCompilerVersions = _.keys(binPaths); + solcVersion = semver.maxSatisfying(availableCompilerVersions, solcVersionRange); + } const fullSolcVersion = binPaths[solcVersion]; const compilerBinFilename = path.join(SOLC_BIN_DIR, fullSolcVersion); let solcjs: string; @@ -229,7 +234,7 @@ export class Compiler { sourceTreeHashHex, compiler: { name: 'solc', - version: solcVersion, + version: fullSolcVersion, settings: this._compilerSettings, }, }; diff --git a/packages/sol-compiler/src/index.ts b/packages/sol-compiler/src/index.ts index 4b4c51de2..15c166992 100644 --- a/packages/sol-compiler/src/index.ts +++ b/packages/sol-compiler/src/index.ts @@ -1,2 +1,3 @@ export { Compiler } from './compiler'; +export { CompilerOptions } from './utils/types'; export { ContractArtifact, ContractNetworks } from './utils/types'; diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts index b12a11b79..d43347fa6 100644 --- a/packages/sol-compiler/src/utils/types.ts +++ b/packages/sol-compiler/src/utils/types.ts @@ -55,6 +55,7 @@ export interface CompilerOptions { artifactsDir?: string; compilerSettings?: solc.CompilerSettings; contracts?: string[] | '*'; + solcVersion?: string; } export interface ContractSourceData { -- cgit v1.2.3 From 842f2ea5cc75c66397597a21202f4b8cf3082ed6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 May 2018 18:34:04 +0200 Subject: Fix a bug in FS resolver causing it to try reading directories --- packages/sol-resolver/src/resolvers/fs_resolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-resolver/src/resolvers/fs_resolver.ts b/packages/sol-resolver/src/resolvers/fs_resolver.ts index 4f05fba88..63fc3448e 100644 --- a/packages/sol-resolver/src/resolvers/fs_resolver.ts +++ b/packages/sol-resolver/src/resolvers/fs_resolver.ts @@ -7,7 +7,7 @@ import { Resolver } from './resolver'; export class FSResolver extends Resolver { // tslint:disable-next-line:prefer-function-over-method public resolveIfExists(importPath: string): ContractSource | undefined { - if (fs.existsSync(importPath)) { + if (fs.existsSync(importPath) && fs.lstatSync(importPath).isFile()) { const fileContent = fs.readFileSync(importPath).toString(); return { source: fileContent, -- cgit v1.2.3 From 60b1fdd367101047d433d4b9c1c47925925296a2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 May 2018 18:34:37 +0200 Subject: Only look at *.sol files in NameResolver --- packages/sol-resolver/src/resolvers/name_resolver.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/sol-resolver/src/resolvers/name_resolver.ts b/packages/sol-resolver/src/resolvers/name_resolver.ts index 76bed802e..586fad86a 100644 --- a/packages/sol-resolver/src/resolvers/name_resolver.ts +++ b/packages/sol-resolver/src/resolvers/name_resolver.ts @@ -6,6 +6,8 @@ import { ContractSource } from '../types'; import { EnumerableResolver } from './enumerable_resolver'; +const SOLIDITY_FILE_EXTENSION = '.sol'; + export class NameResolver extends EnumerableResolver { private _contractsDir: string; constructor(contractsDir: string) { @@ -13,7 +15,6 @@ export class NameResolver extends EnumerableResolver { this._contractsDir = contractsDir; } public resolveIfExists(lookupContractName: string): ContractSource | undefined { - const SOLIDITY_FILE_EXTENSION = '.sol'; let contractSource: ContractSource | undefined; const onFile = (filePath: string) => { const contractName = path.basename(filePath, SOLIDITY_FILE_EXTENSION); @@ -32,7 +33,6 @@ export class NameResolver extends EnumerableResolver { return contractSource; } public getAll(): ContractSource[] { - const SOLIDITY_FILE_EXTENSION = '.sol'; const contractSources: ContractSource[] = []; const onFile = (filePath: string) => { const contractName = path.basename(filePath, SOLIDITY_FILE_EXTENSION); @@ -56,6 +56,9 @@ export class NameResolver extends EnumerableResolver { throw new Error(`No directory found at ${dirPath}`); } for (const fileName of dirContents) { + if (!fileName.endsWith(SOLIDITY_FILE_EXTENSION)) { + continue; + } const absoluteEntryPath = path.join(dirPath, fileName); const isDirectory = fs.lstatSync(absoluteEntryPath).isDirectory(); const entryPath = path.relative(this._contractsDir, absoluteEntryPath); -- cgit v1.2.3 From 974575b695108dd70f4b165f6789f71c3647c2b1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 May 2018 20:01:18 +0200 Subject: Make sol-cov work with truffle and other artifact adapters --- packages/dev-utils/src/coverage.ts | 5 +- packages/metacoin/test/utils/config.ts | 4 +- packages/metacoin/test/utils/coverage.ts | 5 +- packages/sol-cov/package.json | 4 + packages/sol-cov/src/artifact_adapters/0x.ts | 41 +++++++++ packages/sol-cov/src/artifact_adapters/abstract.ts | 5 ++ packages/sol-cov/src/artifact_adapters/truffle.ts | 43 +++++++++ packages/sol-cov/src/collect_contract_data.ts | 31 ------- packages/sol-cov/src/coverage_manager.ts | 99 ++++++++++++-------- packages/sol-cov/src/coverage_subprovider.ts | 38 +++++--- packages/sol-cov/src/index.ts | 4 + packages/sol-cov/src/trace.ts | 100 +++++++++++++++++++++ .../sol-cov/test/collect_contracts_data_test.ts | 7 +- packages/sol-cov/test/trace_test.ts | 57 ++++++++++++ 14 files changed, 354 insertions(+), 89 deletions(-) create mode 100644 packages/sol-cov/src/artifact_adapters/0x.ts create mode 100644 packages/sol-cov/src/artifact_adapters/abstract.ts create mode 100644 packages/sol-cov/src/artifact_adapters/truffle.ts delete mode 100644 packages/sol-cov/src/collect_contract_data.ts create mode 100644 packages/sol-cov/src/trace.ts create mode 100644 packages/sol-cov/test/trace_test.ts diff --git a/packages/dev-utils/src/coverage.ts b/packages/dev-utils/src/coverage.ts index 6f7640835..caf04672f 100644 --- a/packages/dev-utils/src/coverage.ts +++ b/packages/dev-utils/src/coverage.ts @@ -1,4 +1,4 @@ -import { CoverageSubprovider } from '@0xproject/sol-cov'; +import { CoverageSubprovider, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; import * as _ from 'lodash'; import { constants } from './constants'; @@ -16,6 +16,7 @@ export const coverage = { const artifactsPath = '../migrations/artifacts/1.0.0'; const contractsPath = 'src/contracts'; const defaultFromAddress = constants.TESTRPC_FIRST_ADDRESS; - return new CoverageSubprovider(artifactsPath, contractsPath, defaultFromAddress); + const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(artifactsPath, contractsPath); + return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); }, }; diff --git a/packages/metacoin/test/utils/config.ts b/packages/metacoin/test/utils/config.ts index 389edb388..ef4932845 100644 --- a/packages/metacoin/test/utils/config.ts +++ b/packages/metacoin/test/utils/config.ts @@ -3,8 +3,8 @@ import * as path from 'path'; export const config = { networkId: 50, - artifactsDir: path.resolve(__dirname, '../../artifacts'), - contractsDir: path.resolve(__dirname, '../../contracts'), + artifactsDir: 'artifacts', + contractsDir: 'contracts', ganacheLogFile: 'ganache.log', txDefaults: { from: devConstants.TESTRPC_FIRST_ADDRESS, diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts index debd544ed..83b56596f 100644 --- a/packages/metacoin/test/utils/coverage.ts +++ b/packages/metacoin/test/utils/coverage.ts @@ -1,5 +1,5 @@ import { devConstants } from '@0xproject/dev-utils'; -import { CoverageSubprovider } from '@0xproject/sol-cov'; +import { CoverageSubprovider, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; import * as _ from 'lodash'; import { config } from './config'; @@ -15,6 +15,7 @@ export const coverage = { }, _getCoverageSubprovider(): CoverageSubprovider { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - return new CoverageSubprovider(config.artifactsDir, config.contractsDir, defaultFromAddress); + const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); + return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); }, }; diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 28ceae0fa..593ff8356 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -48,9 +48,12 @@ "dependencies": { "@0xproject/subproviders": "^0.10.1", "@0xproject/types": "^0.6.3", + "@0xproject/utils": "^0.6.1", + "@0xproject/sol-compiler": "^0.4.3", "@0xproject/typescript-typings": "^0.3.1", "@0xproject/utils": "^0.6.1", "ethereumjs-util": "^5.1.1", + "rimraf": "^2.6.2", "glob": "^7.1.2", "istanbul": "^0.4.5", "lodash": "^4.17.4", @@ -62,6 +65,7 @@ "@0xproject/monorepo-scripts": "^0.1.19", "@0xproject/tslint-config": "^0.4.17", "@types/istanbul": "^0.4.30", + "@types/rimraf": "^2.0.2", "@types/mkdirp": "^0.5.1", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", diff --git a/packages/sol-cov/src/artifact_adapters/0x.ts b/packages/sol-cov/src/artifact_adapters/0x.ts new file mode 100644 index 000000000..87d23b0aa --- /dev/null +++ b/packages/sol-cov/src/artifact_adapters/0x.ts @@ -0,0 +1,41 @@ +import * as fs from 'fs'; +import * as glob from 'glob'; +import * as _ from 'lodash'; +import * as path from 'path'; + +import { ContractData } from '../types'; + +import { AbstractArtifactAdapter } from './abstract'; + +export class ZeroExArtifactAdapter extends AbstractArtifactAdapter { + private _artifactsPath: string; + private _sourcesPath: string; + constructor(artifactsPath: string, sourcesPath: string) { + super(); + this._artifactsPath = artifactsPath; + this._sourcesPath = sourcesPath; + } + public async collectContractsDataAsync(): Promise { + const artifactsGlob = `${this._artifactsPath}/**/*.json`; + const artifactFileNames = glob.sync(artifactsGlob, { absolute: true }); + const contractsData: ContractData[] = []; + for (const artifactFileName of artifactFileNames) { + const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString()); + let sources = _.keys(artifact.sources); + sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath)); + const contractName = artifact.contractName; + // We don't compute coverage for dependencies + const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString()); + const contractData = { + sourceCodes, + sources, + bytecode: artifact.compilerOutput.evm.bytecode.object, + sourceMap: artifact.compilerOutput.evm.bytecode.sourceMap, + runtimeBytecode: artifact.compilerOutput.evm.deployedBytecode.object, + sourceMapRuntime: artifact.compilerOutput.evm.deployedBytecode.sourceMap, + }; + contractsData.push(contractData); + } + return contractsData; + } +} diff --git a/packages/sol-cov/src/artifact_adapters/abstract.ts b/packages/sol-cov/src/artifact_adapters/abstract.ts new file mode 100644 index 000000000..fcc6562ad --- /dev/null +++ b/packages/sol-cov/src/artifact_adapters/abstract.ts @@ -0,0 +1,5 @@ +import { ContractData } from '../types'; + +export abstract class AbstractArtifactAdapter { + public abstract async collectContractsDataAsync(): Promise; +} diff --git a/packages/sol-cov/src/artifact_adapters/truffle.ts b/packages/sol-cov/src/artifact_adapters/truffle.ts new file mode 100644 index 000000000..e891bb464 --- /dev/null +++ b/packages/sol-cov/src/artifact_adapters/truffle.ts @@ -0,0 +1,43 @@ +import { Compiler, CompilerOptions } from '@0xproject/sol-compiler'; +import * as fs from 'fs'; +import * as glob from 'glob'; +import * as _ from 'lodash'; +import * as path from 'path'; +import * as rimraf from 'rimraf'; + +import { ContractData } from '../types'; + +import { ZeroExArtifactAdapter } from './0x'; +import { AbstractArtifactAdapter } from './abstract'; + +export class TruffleArtifactAdapter extends AbstractArtifactAdapter { + private _solcVersion: string; + private _sourcesPath: string; + constructor(sourcesPath: string, solcVersion: string) { + super(); + this._solcVersion = solcVersion; + this._sourcesPath = sourcesPath; + } + public async collectContractsDataAsync(): Promise { + const artifactsDir = '0x-artifacts'; + const compilerOptions: CompilerOptions = { + contractsDir: this._sourcesPath, + artifactsDir, + compilerSettings: { + outputSelection: { + ['*']: { + ['*']: ['abi', 'evm.bytecode.object', 'evm.deployedBytecode.object'], + }, + }, + }, + contracts: '*', + solcVersion: this._solcVersion, + }; + const compiler = new Compiler(compilerOptions); + await compiler.compileAsync(); + const zeroExArtifactAdapter = new ZeroExArtifactAdapter(artifactsDir, this._sourcesPath); + const contractsDataFrom0xArtifacts = await zeroExArtifactAdapter.collectContractsDataAsync(); + rimraf.sync(artifactsDir); + return contractsDataFrom0xArtifacts; + } +} diff --git a/packages/sol-cov/src/collect_contract_data.ts b/packages/sol-cov/src/collect_contract_data.ts deleted file mode 100644 index 2c2a12835..000000000 --- a/packages/sol-cov/src/collect_contract_data.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as fs from 'fs'; -import * as glob from 'glob'; -import * as _ from 'lodash'; -import * as path from 'path'; - -import { ContractData } from './types'; - -export const collectContractsData = (artifactsPath: string, sourcesPath: string) => { - const artifactsGlob = `${artifactsPath}/**/*.json`; - const artifactFileNames = glob.sync(artifactsGlob, { absolute: true }); - const contractsData: ContractData[] = []; - _.forEach(artifactFileNames, artifactFileName => { - const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString()); - const sources = _.keys(artifact.sources); - const contractName = artifact.contractName; - // We don't compute coverage for dependencies - const sourceCodes = _.map(sources, (source: string) => - fs.readFileSync(path.join(sourcesPath, source)).toString(), - ); - const contractData = { - sourceCodes, - sources, - bytecode: artifact.compilerOutput.evm.bytecode.object, - sourceMap: artifact.compilerOutput.evm.bytecode.sourceMap, - runtimeBytecode: artifact.compilerOutput.evm.deployedBytecode.object, - sourceMapRuntime: artifact.compilerOutput.evm.deployedBytecode.sourceMap, - }; - contractsData.push(contractData); - }); - return contractsData; -}; diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index 800ca96dd..65a6086c0 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -6,7 +6,7 @@ import * as _ from 'lodash'; import * as mkdirp from 'mkdirp'; import * as path from 'path'; -import { collectContractsData } from './collect_contract_data'; +import { AbstractArtifactAdapter } from './artifact_adapters/abstract'; import { collectCoverageEntries } from './collect_coverage_entries'; import { constants } from './constants'; import { parseSourceMap } from './source_maps'; @@ -34,41 +34,23 @@ import { utils } from './utils'; const mkdirpAsync = promisify(mkdirp); export class CoverageManager { - private _sourcesPath: string; + private _artifactAdapter: AbstractArtifactAdapter; + private _verbose: boolean; private _traceInfos: TraceInfo[] = []; - private _contractsData: ContractData[] = []; private _getContractCodeAsync: (address: string) => Promise; - constructor( - artifactsPath: string, - sourcesPath: string, - getContractCodeAsync: (address: string) => Promise, - ) { - this._getContractCodeAsync = getContractCodeAsync; - this._sourcesPath = sourcesPath; - this._contractsData = collectContractsData(artifactsPath, this._sourcesPath); - } - public appendTraceInfo(traceInfo: TraceInfo): void { - this._traceInfos.push(traceInfo); - } - public async writeCoverageAsync(): Promise { - const finalCoverage = await this._computeCoverageAsync(); - const stringifiedCoverage = JSON.stringify(finalCoverage, null, '\t'); - await mkdirpAsync('coverage'); - fs.writeFileSync('coverage/coverage.json', stringifiedCoverage); - } - private _getSingleFileCoverageForTrace( + private static _getSingleFileCoverageForTrace( contractData: ContractData, coveredPcs: number[], pcToSourceRange: { [programCounter: number]: SourceRange }, fileIndex: number, ): Coverage { - const fileName = contractData.sources[fileIndex]; + const absoluteFileName = contractData.sources[fileIndex]; const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex]); let sourceRanges = _.map(coveredPcs, coveredPc => pcToSourceRange[coveredPc]); sourceRanges = _.compact(sourceRanges); // Some PC's don't map to a source range and we just ignore them. // By default lodash does a shallow object comparasion. We JSON.stringify them and compare as strings. sourceRanges = _.uniqBy(sourceRanges, s => JSON.stringify(s)); // We don't care if one PC was covered multiple times within a single transaction - sourceRanges = _.filter(sourceRanges, sourceRange => sourceRange.fileName === fileName); + sourceRanges = _.filter(sourceRanges, sourceRange => sourceRange.fileName === absoluteFileName); const branchCoverage: BranchCoverage = {}; const branchIds = _.keys(coverageEntriesDescription.branchMap); for (const branchId of branchIds) { @@ -118,7 +100,6 @@ export class CoverageManager { ); statementCoverage[modifierStatementId] = isModifierCovered; } - const absoluteFileName = path.join(this._sourcesPath, fileName); const partialCoverage = { [absoluteFileName]: { ...coverageEntriesDescription, @@ -131,18 +112,53 @@ export class CoverageManager { }; return partialCoverage; } + constructor( + artifactAdapter: AbstractArtifactAdapter, + getContractCodeAsync: (address: string) => Promise, + verbose: boolean, + ) { + this._getContractCodeAsync = getContractCodeAsync; + this._artifactAdapter = artifactAdapter; + this._verbose = verbose; + } + public appendTraceInfo(traceInfo: TraceInfo): void { + // console.log(JSON.stringify(traceInfo, null, '\n')); + this._traceInfos.push(traceInfo); + } + public async writeCoverageAsync(): Promise { + const finalCoverage = await this._computeCoverageAsync(); + const stringifiedCoverage = JSON.stringify(finalCoverage, null, '\t'); + await mkdirpAsync('coverage'); + fs.writeFileSync('coverage/coverage.json', stringifiedCoverage); + } private async _computeCoverageAsync(): Promise { + const contractsData = await this._artifactAdapter.collectContractsDataAsync(); const collector = new Collector(); for (const traceInfo of this._traceInfos) { if (traceInfo.address !== constants.NEW_CONTRACT) { // Runtime transaction let runtimeBytecode = (traceInfo as TraceInfoExistingContract).runtimeBytecode; runtimeBytecode = addHexPrefix(runtimeBytecode); - const contractData = _.find(this._contractsData, { runtimeBytecode }) as ContractData; + const contractData = _.find(contractsData, contractDataCandidate => { + // Library linking placeholder: __ConvertLib____________________________ + let runtimeBytecodeRegex = contractDataCandidate.runtimeBytecode.replace(/_.*_/, '.*'); + // Last 86 characters is solidity compiler metadata that's different between compilations + runtimeBytecodeRegex = runtimeBytecodeRegex.replace(/.{86}$/, ''); + // Libraries contain their own address at the beginning of the code and it's impossible to know it in advance + runtimeBytecodeRegex = runtimeBytecodeRegex.replace( + /^0x730000000000000000000000000000000000000000/, + '0x73........................................', + ); + return !_.isNull(runtimeBytecode.match(runtimeBytecodeRegex)); + }) as ContractData; if (_.isUndefined(contractData)) { - throw new Error(`Transaction to an unknown address: ${traceInfo.address}`); + if (this._verbose) { + // tslint:disable-next-line:no-console + console.warn(`Transaction to an unknown address: ${traceInfo.address}`); + } + continue; } - const bytecodeHex = contractData.runtimeBytecode.slice(2); + const bytecodeHex = runtimeBytecode.slice(2); const sourceMap = contractData.sourceMapRuntime; const pcToSourceRange = parseSourceMap( contractData.sourceCodes, @@ -151,7 +167,7 @@ export class CoverageManager { contractData.sources, ); for (let fileIndex = 0; fileIndex < contractData.sources.length; fileIndex++) { - const singleFileCoverageForTrace = this._getSingleFileCoverageForTrace( + const singleFileCoverageForTrace = CoverageManager._getSingleFileCoverageForTrace( contractData, traceInfo.coveredPcs, pcToSourceRange, @@ -163,13 +179,26 @@ export class CoverageManager { // Contract creation transaction let bytecode = (traceInfo as TraceInfoNewContract).bytecode; bytecode = addHexPrefix(bytecode); - const contractData = _.find(this._contractsData, contractDataCandidate => - bytecode.startsWith(contractDataCandidate.bytecode), - ) as ContractData; + const contractData = _.find(contractsData, contractDataCandidate => { + // Library linking placeholder: __ConvertLib____________________________ + let bytecodeRegex = contractDataCandidate.bytecode.replace(/_.*_/, '.*'); + // Last 86 characters is solidity compiler metadata that's different between compilations + bytecodeRegex = bytecodeRegex.replace(/.{86}$/, ''); + // Libraries contain their own address at the beginning of the code and it's impossible to know it in advance + bytecodeRegex = bytecodeRegex.replace( + /^0x730000000000000000000000000000000000000000/, + '0x73........................................', + ); + return !_.isNull(bytecode.match(bytecodeRegex)); + }) as ContractData; if (_.isUndefined(contractData)) { - throw new Error(`Unknown contract creation transaction`); + if (this._verbose) { + // tslint:disable-next-line:no-console + console.warn(`Unknown contract creation transaction`); + } + continue; } - const bytecodeHex = contractData.bytecode.slice(2); + const bytecodeHex = bytecode.slice(2); const sourceMap = contractData.sourceMap; const pcToSourceRange = parseSourceMap( contractData.sourceCodes, @@ -178,7 +207,7 @@ export class CoverageManager { contractData.sources, ); for (let fileIndex = 0; fileIndex < contractData.sources.length; fileIndex++) { - const singleFileCoverageForTrace = this._getSingleFileCoverageForTrace( + const singleFileCoverageForTrace = CoverageManager._getSingleFileCoverageForTrace( contractData, traceInfo.coveredPcs, pcToSourceRange, diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index 08efeaa24..f421a17fd 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -1,10 +1,13 @@ import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders'; import { BlockParam, CallData, JSONRPCRequestPayload, TransactionTrace, TxData } from '@0xproject/types'; +import * as fs from 'fs'; import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; +import { AbstractArtifactAdapter } from './artifact_adapters/abstract'; import { constants } from './constants'; import { CoverageManager } from './coverage_manager'; +import { getTracesByContractAddress } from './trace'; import { TraceInfoExistingContract, TraceInfoNewContract } from './types'; interface MaybeFakeTxData extends TxData { @@ -26,15 +29,15 @@ export class CoverageSubprovider extends Subprovider { private _defaultFromAddress: string; /** * Instantiates a CoverageSubprovider instance - * @param artifactsPath Path to the smart contract artifacts - * @param sourcesPath Path to the smart contract source files + * @param artifactAdapter Adapter for used artifacts format (0x, truffle, giveth, etc.) * @param defaultFromAddress default from address to use when sending transactions + * @param verbose If true, we will log any unknown transactions. Otherwise we will ignore them */ - constructor(artifactsPath: string, sourcesPath: string, defaultFromAddress: string) { + constructor(artifactAdapter: AbstractArtifactAdapter, defaultFromAddress: string, verbose: boolean = true) { super(); this._lock = new Lock(); this._defaultFromAddress = defaultFromAddress; - this._coverageManager = new CoverageManager(artifactsPath, sourcesPath, this._getContractCodeAsync.bind(this)); + this._coverageManager = new CoverageManager(artifactAdapter, this._getContractCodeAsync.bind(this), verbose); } /** * Write the test coverage results to a file in Istanbul format. @@ -119,8 +122,10 @@ export class CoverageSubprovider extends Subprovider { }; const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); const trace: TransactionTrace = jsonRPCResponsePayload.result; - const coveredPcs = _.map(trace.structLogs, log => log.pc); if (address === constants.NEW_CONTRACT) { + // TODO handle calls to external contracts and contract creations from within the constructor + const structLogsOnDepth0 = _.filter(trace.structLogs, { depth: 0 }); + const coveredPcs = _.map(structLogsOnDepth0, log => log.pc); const traceInfo: TraceInfoNewContract = { coveredPcs, txHash, @@ -129,15 +134,20 @@ export class CoverageSubprovider extends Subprovider { }; this._coverageManager.appendTraceInfo(traceInfo); } else { - payload = { method: 'eth_getCode', params: [address, 'latest'] }; - const runtimeBytecode = (await this.emitPayloadAsync(payload)).result; - const traceInfo: TraceInfoExistingContract = { - coveredPcs, - txHash, - address, - runtimeBytecode, - }; - this._coverageManager.appendTraceInfo(traceInfo); + const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); + for (const subcallAddress of _.keys(tracesByContractAddress)) { + payload = { method: 'eth_getCode', params: [subcallAddress, 'latest'] }; + const runtimeBytecode = (await this.emitPayloadAsync(payload)).result; + const traceForThatSubcall = tracesByContractAddress[subcallAddress]; + const coveredPcs = _.map(traceForThatSubcall, log => log.pc); + const traceInfo: TraceInfoExistingContract = { + coveredPcs, + txHash, + address: subcallAddress, + runtimeBytecode, + }; + this._coverageManager.appendTraceInfo(traceInfo); + } } } private async _recordCallTraceAsync(callData: Partial, blockNumber: BlockParam): Promise { diff --git a/packages/sol-cov/src/index.ts b/packages/sol-cov/src/index.ts index e5c5e5be3..18031372b 100644 --- a/packages/sol-cov/src/index.ts +++ b/packages/sol-cov/src/index.ts @@ -1 +1,5 @@ export { CoverageSubprovider } from './coverage_subprovider'; +export { ZeroExArtifactAdapter } from './artifact_adapters/0x'; +export { TruffleArtifactAdapter } from './artifact_adapters/truffle'; +export { AbstractArtifactAdapter } from './artifact_adapters/abstract'; +export { ContractData } from './types'; diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts new file mode 100644 index 000000000..6bc28989d --- /dev/null +++ b/packages/sol-cov/src/trace.ts @@ -0,0 +1,100 @@ +import { StructLog, TransactionTrace } from '@0xproject/types'; +import { BigNumber } from '@0xproject/utils'; +import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; +import * as fs from 'fs'; +import * as _ from 'lodash'; + +export interface TraceByContractAddress { + [contractAddress: string]: StructLog[]; +} +function padZeros(address: string) { + return addHexPrefix(_.padStart(stripHexPrefix(address), 40, '0')); +} + +export function getTracesByContractAddress(structLogs: StructLog[], startAddress: string): TraceByContractAddress { + const traceByContractAddress: TraceByContractAddress = {}; + let currentTraceSegment = []; + const callStack = [startAddress]; + // tslint:disable-next-line: prefer-for-of + for (let i = 0; i < structLogs.length; ++i) { + const structLog = structLogs[i]; + if (structLog.depth !== callStack.length - 1) { + throw new Error("Malformed trace. trace depth doesn't match call stack depth"); + } + // After that check we have a guarantee that call stack is never empty + // If it would: callStack.length - 1 === structLog.depth === -1 + // That means that we can always safely pop from it + currentTraceSegment.push(structLog); + + if (structLog.op === 'DELEGATECALL') { + const currentAddress = _.last(callStack) as string; + const jumpAddressOffset = 4; + const newAddress = padZeros(new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16)); + callStack.push(newAddress); + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + } else if (structLog.op === 'RETURN') { + const currentAddress = callStack.pop() as string; + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + } else if (structLog.op === 'STOP') { + const currentAddress = callStack.pop() as string; + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + if (i !== structLogs.length - 1) { + throw new Error('Malformed trace. STOP is not the last opcode executed'); + } + } else if (structLog.op === 'CREATE') { + console.warn( + "Detected a contract created from within another contract. Sol-cov currently doesn't support that scenario. We'll just skip that trace", + ); + return traceByContractAddress; + } else if (structLog.op === 'CALL') { + const currentAddress = _.last(callStack) as string; + const jumpAddressOffset = 2; + const newAddress = padZeros(new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16)); + callStack.push(newAddress); + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + } else if (structLog.op === 'CALLCODE') { + throw new Error('CALLCODE opcode unsupported by coverage'); + } else if (structLog.op === 'STATICCALL') { + throw new Error('STATICCALL opcode unsupported by coverage'); + } else if (structLog.op === 'REVERT') { + const currentAddress = callStack.pop() as string; + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + if (i !== structLogs.length - 1) { + throw new Error('Malformed trace. REVERT is not the last opcode executed'); + } + } else if (structLog.op === 'INVALID') { + const currentAddress = callStack.pop() as string; + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + if (i !== structLogs.length - 1) { + throw new Error('Malformed trace. INVALID is not the last opcode executed'); + } + } else if (structLog.op === 'SELFDESTRUCT') { + throw new Error('SELFDESTRUCT opcode unsupported by coverage'); + } + } + if (callStack.length !== 0) { + throw new Error('Malformed trace. Call stack non empty at the end'); + } + if (currentTraceSegment.length !== 0) { + throw new Error('Malformed trace. currentTraceSegment non empty at the end'); + } + return traceByContractAddress; +} diff --git a/packages/sol-cov/test/collect_contracts_data_test.ts b/packages/sol-cov/test/collect_contracts_data_test.ts index d84ac5a39..906b7f4e2 100644 --- a/packages/sol-cov/test/collect_contracts_data_test.ts +++ b/packages/sol-cov/test/collect_contracts_data_test.ts @@ -4,16 +4,17 @@ import 'make-promises-safe'; import 'mocha'; import * as path from 'path'; -import { collectContractsData } from '../src/collect_contract_data'; +import { ZeroExArtifactAdapter } from '../src/artifact_adapters/0x'; const expect = chai.expect; describe('Collect contracts data', () => { describe('#collectContractsData', () => { - it('correctly collects contracts data', () => { + it('correctly collects contracts data', async () => { const artifactsPath = path.resolve(__dirname, 'fixtures/artifacts'); const sourcesPath = path.resolve(__dirname, 'fixtures/contracts'); - const contractsData = collectContractsData(artifactsPath, sourcesPath); + const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(artifactsPath, sourcesPath); + const contractsData = await zeroExArtifactsAdapter.collectContractsDataAsync(); _.forEach(contractsData, contractData => { expect(contractData).to.have.keys([ 'sourceCodes', diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts new file mode 100644 index 000000000..b9d846732 --- /dev/null +++ b/packages/sol-cov/test/trace_test.ts @@ -0,0 +1,57 @@ +import { StructLog } from '@0xproject/types'; +import * as chai from 'chai'; +import * as fs from 'fs'; +import * as _ from 'lodash'; +import 'mocha'; +import * as path from 'path'; + +import { getTracesByContractAddress } from '../src/trace'; + +const expect = chai.expect; + +const DEFAULT_STRUCT_LOG: StructLog = { + depth: 0, + error: '', + gas: 0, + gasCost: 0, + memory: [], + op: 'DEFAULT', + pc: 0, + stack: [], + storage: {}, +}; + +function addDefaultStructLogFields(compactStructLog: Partial & { op: string; depth: number }): StructLog { + return { ...DEFAULT_STRUCT_LOG, ...compactStructLog }; +} + +describe('Trace', () => { + describe('#getTracesByContractAddress', () => { + it('correctly splits trace by contract address', () => { + const delegateCallAddress = '0x0000000000000000000000000000000000000002'; + const trace = [ + { + op: 'DELEGATECALL', + stack: ['0x', '0x', delegateCallAddress], + depth: 0, + }, + { + op: 'RETURN', + depth: 1, + }, + { + op: 'RETURN', + depth: 0, + }, + ]; + const fullTrace = _.map(trace, compactStructLog => addDefaultStructLogFields(compactStructLog)); + const startAddress = '0x0000000000000000000000000000000000000001'; + const traceByContractAddress = getTracesByContractAddress(fullTrace, startAddress); + const expectedTraceByContractAddress = { + [startAddress]: [fullTrace[0], fullTrace[2]], + [delegateCallAddress]: [fullTrace[1]], + }; + expect(traceByContractAddress).to.be.deep.equal(expectedTraceByContractAddress); + }); + }); +}); -- cgit v1.2.3 From 427a29145d90070e8c67753e7f76c7b88322eefb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 11:13:01 +0200 Subject: Support all opcodes in a trace parser --- packages/sol-cov/src/trace.ts | 72 +++++++++++++------------------------ packages/sol-cov/test/trace_test.ts | 12 +++---- packages/types/src/index.ts | 13 ++++++- packages/utils/src/log_utils.ts | 3 ++ 4 files changed, 45 insertions(+), 55 deletions(-) diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 6bc28989d..febb1034e 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -1,5 +1,5 @@ -import { StructLog, TransactionTrace } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; +import { OpCode, StructLog, TransactionTrace } from '@0xproject/types'; +import { BigNumber, logUtils } from '@0xproject/utils'; import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -26,68 +26,44 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress // That means that we can always safely pop from it currentTraceSegment.push(structLog); - if (structLog.op === 'DELEGATECALL') { + if ( + structLog.op === OpCode.CallCode || + structLog.op === OpCode.StaticCall || + structLog.op === OpCode.Call || + structLog.op === OpCode.DelegateCall + ) { const currentAddress = _.last(callStack) as string; - const jumpAddressOffset = 4; + const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2; const newAddress = padZeros(new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16)); callStack.push(newAddress); traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( currentTraceSegment, ); currentTraceSegment = []; - } else if (structLog.op === 'RETURN') { + } else if ( + structLog.op === OpCode.Return || + structLog.op === OpCode.Stop || + structLog.op === OpCode.Revert || + structLog.op === OpCode.Invalid || + structLog.op === OpCode.SelfDestruct + ) { const currentAddress = callStack.pop() as string; traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( currentTraceSegment, ); currentTraceSegment = []; - } else if (structLog.op === 'STOP') { - const currentAddress = callStack.pop() as string; - traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( - currentTraceSegment, - ); - currentTraceSegment = []; - if (i !== structLogs.length - 1) { - throw new Error('Malformed trace. STOP is not the last opcode executed'); + if (structLog.op === OpCode.SelfDestruct) { + // TODO: Record contract bytecode before the selfdestruct and handle that scenario + logUtils.warn( + "Detected a selfdestruct. Sol-cov currently doesn't support that scenario. We'll just skip the trace part for a destructed contract", + ); } - } else if (structLog.op === 'CREATE') { - console.warn( + } else if (structLog.op === OpCode.Create) { + // TODO: Extract the new contract address from the stack and handle that scenario + logUtils.warn( "Detected a contract created from within another contract. Sol-cov currently doesn't support that scenario. We'll just skip that trace", ); return traceByContractAddress; - } else if (structLog.op === 'CALL') { - const currentAddress = _.last(callStack) as string; - const jumpAddressOffset = 2; - const newAddress = padZeros(new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16)); - callStack.push(newAddress); - traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( - currentTraceSegment, - ); - currentTraceSegment = []; - } else if (structLog.op === 'CALLCODE') { - throw new Error('CALLCODE opcode unsupported by coverage'); - } else if (structLog.op === 'STATICCALL') { - throw new Error('STATICCALL opcode unsupported by coverage'); - } else if (structLog.op === 'REVERT') { - const currentAddress = callStack.pop() as string; - traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( - currentTraceSegment, - ); - currentTraceSegment = []; - if (i !== structLogs.length - 1) { - throw new Error('Malformed trace. REVERT is not the last opcode executed'); - } - } else if (structLog.op === 'INVALID') { - const currentAddress = callStack.pop() as string; - traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( - currentTraceSegment, - ); - currentTraceSegment = []; - if (i !== structLogs.length - 1) { - throw new Error('Malformed trace. INVALID is not the last opcode executed'); - } - } else if (structLog.op === 'SELFDESTRUCT') { - throw new Error('SELFDESTRUCT opcode unsupported by coverage'); } } if (callStack.length !== 0) { diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts index b9d846732..58b9203b0 100644 --- a/packages/sol-cov/test/trace_test.ts +++ b/packages/sol-cov/test/trace_test.ts @@ -1,4 +1,4 @@ -import { StructLog } from '@0xproject/types'; +import { OpCode, StructLog } from '@0xproject/types'; import * as chai from 'chai'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -15,13 +15,13 @@ const DEFAULT_STRUCT_LOG: StructLog = { gas: 0, gasCost: 0, memory: [], - op: 'DEFAULT', + op: OpCode.Invalid, pc: 0, stack: [], storage: {}, }; -function addDefaultStructLogFields(compactStructLog: Partial & { op: string; depth: number }): StructLog { +function addDefaultStructLogFields(compactStructLog: Partial & { op: OpCode; depth: number }): StructLog { return { ...DEFAULT_STRUCT_LOG, ...compactStructLog }; } @@ -31,16 +31,16 @@ describe('Trace', () => { const delegateCallAddress = '0x0000000000000000000000000000000000000002'; const trace = [ { - op: 'DELEGATECALL', + op: OpCode.DelegateCall, stack: ['0x', '0x', delegateCallAddress], depth: 0, }, { - op: 'RETURN', + op: OpCode.Return, depth: 1, }, { - op: 'RETURN', + op: OpCode.Return, depth: 0, }, ]; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index f28c2f9a3..055c47e0a 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -58,7 +58,18 @@ export interface DataItem { components?: DataItem[]; } -export type OpCode = string; +export enum OpCode { + DelegateCall = 'DELEGATECALL', + Revert = 'REVERT', + Create = 'CREATE', + Stop = 'STOP', + Invalid = 'INVALID', + CallCode = 'CALLCODE', + StaticCall = 'STATICCALL', + Return = 'RETURN', + Call = 'CALL', + SelfDestruct = 'SELFDESTRUCT', +} export interface StructLog { depth: number; diff --git a/packages/utils/src/log_utils.ts b/packages/utils/src/log_utils.ts index d0f0e34c9..87f8479b5 100644 --- a/packages/utils/src/log_utils.ts +++ b/packages/utils/src/log_utils.ts @@ -2,4 +2,7 @@ export const logUtils = { log(...args: any[]): void { console.log(...args); // tslint:disable-line:no-console }, + warn(...args: any[]): void { + console.warn(...args); // tslint:disable-line:no-console + }, }; -- cgit v1.2.3 From b86248f13fcb8f326098252beee6ca557e0175e7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 11:29:52 +0200 Subject: Add CHANGELOG entries --- packages/dev-utils/CHANGELOG.json | 4 + packages/sol-compiler/CHANGELOG.json | 4 + packages/sol-cov/CHANGELOG.json | 21 + packages/sol-resolver/CHANGELOG.json | 13 + packages/testnet-faucets/bin/server.js | 780 +++++++++++++++++++++++++++++ packages/testnet-faucets/bin/server.js.map | 1 + packages/types/CHANGELOG.json | 4 + packages/utils/CHANGELOG.json | 9 + 8 files changed, 836 insertions(+) create mode 100644 packages/testnet-faucets/bin/server.js create mode 100644 packages/testnet-faucets/bin/server.js.map diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index 3f70a93cc..72ecdbabb 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -2,6 +2,10 @@ { "version": "0.4.2", "changes": [ + { + "note": "Pass ZeroExArtifactsAdapter to CoverageSubprovider", + "pr": 589 + }, { "note": "Move callbackErrorReporter over from 0x.js", "pr": 579 diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index a1b53fb9e..35f2c6179 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -5,6 +5,10 @@ { "note": "Properly export the executable binary", "pr": 588 + }, + { + "note": "Add a possibility to define a solidity version to use", + "pr": 589 } ] }, diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index 468957fe3..9c978df5a 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -1,4 +1,25 @@ [ + { + "version": "0.1.0", + "changes": [ + { + "note": "Add artifact adapter as a parameter for CoverageSubprovider. Export AbstractArtifactAdapter", + "pr": 589 + }, + { + "note": "Implement ZeroExArtiactAdapter and TruffleArtifactAdapter", + "pr": 589 + }, + { + "note": "Properly parse multi-level traces", + "pr": 589 + }, + { + "note": "Add support for solidity libraries", + "pr": 589 + } + ] + }, { "timestamp": 1525477860, "version": "0.0.10", diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index 0126fa170..eb52d85e0 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,4 +1,17 @@ [ + { + "version": "0.0.5", + "changes": [ + { + "note": "Fix a bug in FsResolver trying to read directories as files", + "pr": 589 + }, + { + "note": "Fix a bug in NameResolver not ignoring .sol files", + "pr": 589 + } + ] + }, { "timestamp": 1525477860, "version": "0.0.4", diff --git a/packages/testnet-faucets/bin/server.js b/packages/testnet-faucets/bin/server.js new file mode 100644 index 000000000..bee332843 --- /dev/null +++ b/packages/testnet-faucets/bin/server.js @@ -0,0 +1,780 @@ +require("source-map-support").install(); +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 6); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +module.exports = require("@0xproject/utils"); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.configs = { + DISPENSER_ADDRESS: process.env.DISPENSER_ADDRESS.toLowerCase(), + DISPENSER_PRIVATE_KEY: process.env.DISPENSER_PRIVATE_KEY, + ENVIRONMENT: process.env.FAUCET_ENVIRONMENT, + INFURA_API_KEY: process.env.INFURA_API_KEY, + ROLLBAR_ACCESS_KEY: process.env.FAUCET_ROLLBAR_ACCESS_KEY, +}; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = require("lodash"); + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = __webpack_require__(0); +var rollbar = __webpack_require__(10); +var configs_1 = __webpack_require__(1); +exports.errorReporter = { + setup: function () { + var _this = this; + rollbar.init(configs_1.configs.ROLLBAR_ACCESS_KEY, { + environment: configs_1.configs.ENVIRONMENT, + }); + rollbar.handleUncaughtExceptions(configs_1.configs.ROLLBAR_ACCESS_KEY); + process.on('unhandledRejection', function (err) { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + utils_1.logUtils.log("Uncaught exception " + err + ". Stack: " + err.stack); + return [4 /*yield*/, this.reportAsync(err)]; + case 1: + _a.sent(); + process.exit(1); + return [2 /*return*/]; + } + }); + }); }); + }, + reportAsync: function (err, req) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (configs_1.configs.ENVIRONMENT === 'development') { + return [2 /*return*/]; // Do not log development environment errors + } + return [2 /*return*/, new Promise(function (resolve, reject) { + rollbar.handleError(err, req, function (rollbarErr) { + if (rollbarErr) { + utils_1.logUtils.log("Error reporting to rollbar, ignoring: " + rollbarErr); + reject(rollbarErr); + } + else { + resolve(); + } + }); + })]; + }); + }); + }, + errorHandler: function () { + return rollbar.errorHandler(configs_1.configs.ROLLBAR_ACCESS_KEY); + }, +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = require("0x.js"); + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var configs_1 = __webpack_require__(1); +var productionRpcUrls = { + '3': "https://ropsten.infura.io/" + configs_1.configs.INFURA_API_KEY, + '4': "https://rinkeby.infura.io/" + configs_1.configs.INFURA_API_KEY, + '42': "https://kovan.infura.io/" + configs_1.configs.INFURA_API_KEY, +}; +var developmentRpcUrls = { + '50': 'http://127.0.0.1:8545', +}; +exports.rpcUrls = configs_1.configs.ENVIRONMENT === 'development' ? developmentRpcUrls : productionRpcUrls; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(7); + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var bodyParser = __webpack_require__(8); +var express = __webpack_require__(9); +var error_reporter_1 = __webpack_require__(3); +var handler_1 = __webpack_require__(11); +var parameter_transformer_1 = __webpack_require__(18); +// Setup the errorReporter to catch uncaught exceptions and unhandled rejections +error_reporter_1.errorReporter.setup(); +var app = express(); +app.use(bodyParser.json()); // for parsing application/json +app.use(function (req, res, next) { + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); + next(); +}); +var handler = new handler_1.Handler(); +app.get('/ping', function (req, res) { + res.status(200).send('pong'); +}); +app.get('/info', handler.getQueueInfo.bind(handler)); +app.get('/ether/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseEther.bind(handler)); +app.get('/zrx/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseZRX.bind(handler)); +app.get('/order/weth/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseWETHOrder.bind(handler)); +app.get('/order/zrx/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseZRXOrder.bind(handler)); +// Log to rollbar any errors unhandled by handlers +app.use(error_reporter_1.errorReporter.errorHandler()); +var port = process.env.PORT || 3000; +app.listen(port); + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +module.exports = require("body-parser"); + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + +module.exports = require("express"); + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = require("rollbar"); + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _0x_js_1 = __webpack_require__(4); +var utils_1 = __webpack_require__(0); +var _ = __webpack_require__(2); +var Web3 = __webpack_require__(12); +// HACK: web3 injects XMLHttpRequest into the global scope and ProviderEngine checks XMLHttpRequest +// to know whether it is running in a browser or node environment. We need it to be undefined since +// we are not running in a browser env. +// Filed issue: https://github.com/ethereum/web3.js/issues/844 +global.XMLHttpRequest = undefined; +var subproviders_1 = __webpack_require__(13); +var ProviderEngine = __webpack_require__(14); +var RpcSubprovider = __webpack_require__(15); +var configs_1 = __webpack_require__(1); +var dispatch_queue_1 = __webpack_require__(16); +var dispense_asset_tasks_1 = __webpack_require__(17); +var rpc_urls_1 = __webpack_require__(5); +var RequestedAssetType; +(function (RequestedAssetType) { + RequestedAssetType["ETH"] = "ETH"; + RequestedAssetType["WETH"] = "WETH"; + RequestedAssetType["ZRX"] = "ZRX"; +})(RequestedAssetType || (RequestedAssetType = {})); +var FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable +var Handler = /** @class */ (function () { + function Handler() { + var _this = this; + this._networkConfigByNetworkId = {}; + _.forIn(rpc_urls_1.rpcUrls, function (rpcUrl, networkId) { + var providerObj = Handler._createProviderEngine(rpcUrl); + var web3 = new Web3(providerObj); + var zeroExConfig = { + networkId: +networkId, + }; + var zeroEx = new _0x_js_1.ZeroEx(web3.currentProvider, zeroExConfig); + var dispatchQueue = new dispatch_queue_1.DispatchQueue(); + _this._networkConfigByNetworkId[networkId] = { + dispatchQueue: dispatchQueue, + web3: web3, + zeroEx: zeroEx, + }; + }); + } + Handler._createProviderEngine = function (rpcUrl) { + if (_.isUndefined(configs_1.configs.DISPENSER_PRIVATE_KEY)) { + throw new Error('Dispenser Private key not found'); + } + var engine = new ProviderEngine(); + engine.addProvider(new subproviders_1.NonceTrackerSubprovider()); + engine.addProvider(new subproviders_1.PrivateKeyWalletSubprovider(configs_1.configs.DISPENSER_PRIVATE_KEY)); + engine.addProvider(new RpcSubprovider({ + rpcUrl: rpcUrl, + })); + engine.start(); + return engine; + }; + Handler.prototype.getQueueInfo = function (req, res) { + var _this = this; + res.setHeader('Content-Type', 'application/json'); + var queueInfo = _.mapValues(rpc_urls_1.rpcUrls, function (rpcUrl, networkId) { + var dispatchQueue = _this._networkConfigByNetworkId[networkId].dispatchQueue; + return { + full: dispatchQueue.isFull(), + size: dispatchQueue.size(), + }; + }); + var payload = JSON.stringify(queueInfo); + res.status(200).send(payload); + }; + Handler.prototype.dispenseEther = function (req, res) { + this._dispenseAsset(req, res, RequestedAssetType.ETH); + }; + Handler.prototype.dispenseZRX = function (req, res) { + this._dispenseAsset(req, res, RequestedAssetType.ZRX); + }; + Handler.prototype.dispenseWETHOrder = function (req, res) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this._dispenseOrder(req, res, RequestedAssetType.WETH)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + Handler.prototype.dispenseZRXOrder = function (req, res, next) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this._dispenseOrder(req, res, RequestedAssetType.ZRX)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + Handler.prototype._dispenseAsset = function (req, res, requestedAssetType) { + var networkId = req.params.networkId; + var recipient = req.params.recipient; + var networkConfig = this._networkConfigByNetworkId[networkId]; + var dispenserTask; + switch (requestedAssetType) { + case RequestedAssetType.ETH: + dispenserTask = dispense_asset_tasks_1.dispenseAssetTasks.dispenseEtherTask(recipient, networkConfig.web3); + break; + case RequestedAssetType.WETH: + case RequestedAssetType.ZRX: + dispenserTask = dispense_asset_tasks_1.dispenseAssetTasks.dispenseTokenTask(recipient, requestedAssetType, networkConfig.zeroEx); + break; + default: + throw new Error("Unsupported asset type: " + requestedAssetType); + } + var didAddToQueue = networkConfig.dispatchQueue.add(dispenserTask); + if (!didAddToQueue) { + res.status(503).send('QUEUE_IS_FULL'); + return; + } + utils_1.logUtils.log("Added " + recipient + " to queue: " + requestedAssetType + " networkId: " + networkId); + res.status(200).end(); + }; + Handler.prototype._dispenseOrder = function (req, res, requestedAssetType) { + return __awaiter(this, void 0, void 0, function () { + var networkConfig, zeroEx, makerToken, takerTokenSymbol, takerToken, makerTokenAmount, takerTokenAmount, order, orderHash, signature, signedOrder, signedOrderHash, payload; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + networkConfig = _.get(this._networkConfigByNetworkId, req.params.networkId); + if (_.isUndefined(networkConfig)) { + res.status(400).send('UNSUPPORTED_NETWORK_ID'); + return [2 /*return*/]; + } + zeroEx = networkConfig.zeroEx; + res.setHeader('Content-Type', 'application/json'); + return [4 /*yield*/, zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType)]; + case 1: + makerToken = _a.sent(); + if (_.isUndefined(makerToken)) { + throw new Error("Unsupported asset type: " + requestedAssetType); + } + takerTokenSymbol = requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH; + return [4 /*yield*/, zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol)]; + case 2: + takerToken = _a.sent(); + if (_.isUndefined(takerToken)) { + throw new Error("Unsupported asset type: " + requestedAssetType); + } + makerTokenAmount = _0x_js_1.ZeroEx.toBaseUnitAmount(new utils_1.BigNumber(0.1), makerToken.decimals); + takerTokenAmount = _0x_js_1.ZeroEx.toBaseUnitAmount(new utils_1.BigNumber(0.1), takerToken.decimals); + order = { + maker: configs_1.configs.DISPENSER_ADDRESS, + taker: req.params.recipient, + makerFee: new utils_1.BigNumber(0), + takerFee: new utils_1.BigNumber(0), + makerTokenAmount: makerTokenAmount, + takerTokenAmount: takerTokenAmount, + makerTokenAddress: makerToken.address, + takerTokenAddress: takerToken.address, + salt: _0x_js_1.ZeroEx.generatePseudoRandomSalt(), + exchangeContractAddress: zeroEx.exchange.getContractAddress(), + feeRecipient: _0x_js_1.ZeroEx.NULL_ADDRESS, + expirationUnixTimestampSec: new utils_1.BigNumber(Date.now() + FIVE_DAYS_IN_MS), + }; + orderHash = _0x_js_1.ZeroEx.getOrderHashHex(order); + return [4 /*yield*/, zeroEx.signOrderHashAsync(orderHash, configs_1.configs.DISPENSER_ADDRESS, false)]; + case 3: + signature = _a.sent(); + signedOrder = __assign({}, order, { ecSignature: signature }); + signedOrderHash = _0x_js_1.ZeroEx.getOrderHashHex(signedOrder); + payload = JSON.stringify(signedOrder); + utils_1.logUtils.log("Dispensed signed order: " + payload); + res.status(200).send(payload); + return [2 /*return*/]; + } + }); + }); + }; + return Handler; +}()); +exports.Handler = Handler; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +module.exports = require("web3"); + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +module.exports = require("@0xproject/subproviders"); + +/***/ }), +/* 14 */ +/***/ (function(module, exports) { + +module.exports = require("web3-provider-engine"); + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +module.exports = require("web3-provider-engine/subproviders/rpc"); + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = __webpack_require__(0); +var _ = __webpack_require__(2); +var error_reporter_1 = __webpack_require__(3); +var MAX_QUEUE_SIZE = 500; +var DEFAULT_QUEUE_INTERVAL_MS = 1000; +var DispatchQueue = /** @class */ (function () { + function DispatchQueue() { + this._queueIntervalMs = DEFAULT_QUEUE_INTERVAL_MS; + this._queue = []; + this._start(); + } + DispatchQueue.prototype.add = function (taskAsync) { + if (this.isFull()) { + return false; + } + this._queue.push(taskAsync); + return true; + }; + DispatchQueue.prototype.size = function () { + return this._queue.length; + }; + DispatchQueue.prototype.isFull = function () { + return this.size() >= MAX_QUEUE_SIZE; + }; + DispatchQueue.prototype.stop = function () { + if (!_.isUndefined(this._queueIntervalIdIfExists)) { + utils_1.intervalUtils.clearAsyncExcludingInterval(this._queueIntervalIdIfExists); + } + }; + DispatchQueue.prototype._start = function () { + var _this = this; + this._queueIntervalIdIfExists = utils_1.intervalUtils.setAsyncExcludingInterval(function () { return __awaiter(_this, void 0, void 0, function () { + var taskAsync; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + taskAsync = this._queue.shift(); + if (_.isUndefined(taskAsync)) { + return [2 /*return*/, Promise.resolve()]; + } + return [4 /*yield*/, taskAsync()]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); }, this._queueIntervalMs, function (err) { + utils_1.logUtils.log("Unexpected err: " + err + " - " + JSON.stringify(err)); + // tslint:disable-next-line:no-floating-promises + error_reporter_1.errorReporter.reportAsync(err); + }); + }; + return DispatchQueue; +}()); +exports.DispatchQueue = DispatchQueue; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _0x_js_1 = __webpack_require__(4); +var utils_1 = __webpack_require__(0); +var _ = __webpack_require__(2); +var configs_1 = __webpack_require__(1); +var DISPENSE_AMOUNT_ETHER = 0.1; +var DISPENSE_AMOUNT_TOKEN = 0.1; +var DISPENSE_MAX_AMOUNT_TOKEN = 2; +var DISPENSE_MAX_AMOUNT_ETHER = 2; +exports.dispenseAssetTasks = { + dispenseEtherTask: function (recipientAddress, web3) { + var _this = this; + return function () { return __awaiter(_this, void 0, void 0, function () { + var userBalance, maxAmountInWei, sendTransactionAsync, txHash; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + utils_1.logUtils.log("Processing ETH " + recipientAddress); + return [4 /*yield*/, utils_1.promisify(web3.eth.getBalance)(recipientAddress)]; + case 1: + userBalance = _a.sent(); + maxAmountInWei = new utils_1.BigNumber(web3.toWei(DISPENSE_MAX_AMOUNT_ETHER, 'ether')); + if (userBalance.greaterThanOrEqualTo(maxAmountInWei)) { + utils_1.logUtils.log("User exceeded ETH balance maximum (" + maxAmountInWei + ") " + recipientAddress + " " + userBalance + " "); + return [2 /*return*/]; + } + sendTransactionAsync = utils_1.promisify(web3.eth.sendTransaction); + return [4 /*yield*/, sendTransactionAsync({ + from: configs_1.configs.DISPENSER_ADDRESS, + to: recipientAddress, + value: web3.toWei(DISPENSE_AMOUNT_ETHER, 'ether'), + })]; + case 2: + txHash = _a.sent(); + utils_1.logUtils.log("Sent " + DISPENSE_AMOUNT_ETHER + " ETH to " + recipientAddress + " tx: " + txHash); + return [2 /*return*/]; + } + }); + }); }; + }, + dispenseTokenTask: function (recipientAddress, tokenSymbol, zeroEx) { + var _this = this; + return function () { return __awaiter(_this, void 0, void 0, function () { + var amountToDispense, token, baseUnitAmount, userBalanceBaseUnits, maxAmountBaseUnits, txHash; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + utils_1.logUtils.log("Processing " + tokenSymbol + " " + recipientAddress); + amountToDispense = new utils_1.BigNumber(DISPENSE_AMOUNT_TOKEN); + return [4 /*yield*/, zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(tokenSymbol)]; + case 1: + token = _a.sent(); + if (_.isUndefined(token)) { + throw new Error("Unsupported asset type: " + tokenSymbol); + } + baseUnitAmount = _0x_js_1.ZeroEx.toBaseUnitAmount(amountToDispense, token.decimals); + return [4 /*yield*/, zeroEx.token.getBalanceAsync(token.address, recipientAddress)]; + case 2: + userBalanceBaseUnits = _a.sent(); + maxAmountBaseUnits = _0x_js_1.ZeroEx.toBaseUnitAmount(new utils_1.BigNumber(DISPENSE_MAX_AMOUNT_TOKEN), token.decimals); + if (userBalanceBaseUnits.greaterThanOrEqualTo(maxAmountBaseUnits)) { + utils_1.logUtils.log("User exceeded token balance maximum (" + maxAmountBaseUnits + ") " + recipientAddress + " " + userBalanceBaseUnits + " "); + return [2 /*return*/]; + } + return [4 /*yield*/, zeroEx.token.transferAsync(token.address, configs_1.configs.DISPENSER_ADDRESS, recipientAddress, baseUnitAmount)]; + case 3: + txHash = _a.sent(); + utils_1.logUtils.log("Sent " + amountToDispense + " ZRX to " + recipientAddress + " tx: " + txHash); + return [2 /*return*/]; + } + }); + }); }; + }, +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = __webpack_require__(0); +var _ = __webpack_require__(2); +var rpc_urls_1 = __webpack_require__(5); +var DEFAULT_NETWORK_ID = 42; // kovan +exports.parameterTransformer = { + transform: function (req, res, next) { + var recipientAddress = req.params.recipient; + if (_.isUndefined(recipientAddress) || !utils_1.addressUtils.isAddress(recipientAddress)) { + res.status(400).send('INVALID_RECIPIENT_ADDRESS'); + return; + } + var lowerCaseRecipientAddress = recipientAddress.toLowerCase(); + req.params.recipient = lowerCaseRecipientAddress; + var networkId = _.get(req.query, 'networkId', DEFAULT_NETWORK_ID); + var rpcUrlIfExists = _.get(rpc_urls_1.rpcUrls, networkId); + if (_.isUndefined(rpcUrlIfExists)) { + res.status(400).send('UNSUPPORTED_NETWORK_ID'); + return; + } + req.params.networkId = networkId; + next(); + }, +}; + + +/***/ }) +/******/ ]); +//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/packages/testnet-faucets/bin/server.js.map b/packages/testnet-faucets/bin/server.js.map new file mode 100644 index 000000000..c8c227727 --- /dev/null +++ b/packages/testnet-faucets/bin/server.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap b91d2cee364b5e101d43","webpack:///external \"@0xproject/utils\"","webpack:///./src/ts/configs.ts","webpack:///external \"lodash\"","webpack:///./src/ts/error_reporter.ts","webpack:///external \"0x.js\"","webpack:///./src/ts/rpc_urls.ts","webpack:///./src/ts/server.ts","webpack:///external \"body-parser\"","webpack:///external \"express\"","webpack:///external \"rollbar\"","webpack:///./src/ts/handler.ts","webpack:///external \"web3\"","webpack:///external \"@0xproject/subproviders\"","webpack:///external \"web3-provider-engine\"","webpack:///external \"web3-provider-engine/subproviders/rpc\"","webpack:///./src/ts/dispatch_queue.ts","webpack:///./src/ts/dispense_asset_tasks.ts","webpack:///./src/ts/parameter_transformer.ts"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA,6C;;;;;;;;;ACAa,eAAO,GAAG;IACnB,iBAAiB,EAAG,OAAO,CAAC,GAAG,CAAC,iBAA4B,CAAC,WAAW,EAAE;IAC1E,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;IACxD,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;IAC3C,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;IAC1C,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;CAC5D,CAAC;;;;;;;ACNF,mC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,qCAA4C;AAE5C,sCAAoC;AAEpC,uCAAoC;AAEvB,qBAAa,GAAG;IACzB,KAAK;QAAL,iBAUC;QATG,OAAO,CAAC,IAAI,CAAC,iBAAO,CAAC,kBAAkB,EAAE;YACrC,WAAW,EAAE,iBAAO,CAAC,WAAW;SACnC,CAAC,CAAC;QACH,OAAO,CAAC,wBAAwB,CAAC,iBAAO,CAAC,kBAAkB,CAAC,CAAC;QAC7D,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAO,GAAU;;;;wBAC9C,gBAAQ,CAAC,GAAG,CAAC,wBAAsB,GAAG,iBAAY,GAAG,CAAC,KAAO,CAAC,CAAC;wBAC/D,qBAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;;wBAA3B,SAA2B,CAAC;wBAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;aACnB,CAAC,CAAC;IACP,CAAC;IACK,WAAW,EAAjB,UAAkB,GAAU,EAAE,GAAqB;;;gBAC/C,EAAE,CAAC,CAAC,iBAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC;oBACxC,MAAM,gBAAC,CAAC,4CAA4C;gBACxD,CAAC;gBACD,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBAC/B,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,UAAC,UAAiB;4BAC5C,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;gCACb,gBAAQ,CAAC,GAAG,CAAC,2CAAyC,UAAY,CAAC,CAAC;gCACpE,MAAM,CAAC,UAAU,CAAC,CAAC;4BACvB,CAAC;4BAAC,IAAI,CAAC,CAAC;gCACJ,OAAO,EAAE,CAAC;4BACd,CAAC;wBACL,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,EAAC;;;KACN;IACD,YAAY;QACR,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5D,CAAC;CACJ,CAAC;;;;;;;ACpCF,kC;;;;;;;;;ACAA,uCAAoC;AAEpC,IAAM,iBAAiB,GAAG;IACtB,GAAG,EAAE,+BAA6B,iBAAO,CAAC,cAAgB;IAC1D,GAAG,EAAE,+BAA6B,iBAAO,CAAC,cAAgB;IAC1D,IAAI,EAAE,6BAA2B,iBAAO,CAAC,cAAgB;CAC5D,CAAC;AAEF,IAAM,kBAAkB,GAAG;IACvB,IAAI,EAAE,uBAAuB;CAChC,CAAC;AAEW,eAAO,GAAG,iBAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,CAAC;;;;;;;;;;;;;;;;;ACZtG,wCAA0C;AAC1C,qCAAmC;AAEnC,8CAAiD;AACjD,wCAAoC;AACpC,sDAA+D;AAE/D,gFAAgF;AAChF,8BAAa,CAAC,KAAK,EAAE,CAAC;AAEtB,IAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,+BAA+B;AAC3D,GAAG,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,GAAG,EAAE,IAAI;IACnB,GAAG,CAAC,MAAM,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,gDAAgD,CAAC,CAAC;IAC7F,IAAI,EAAE,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,IAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;AAC9B,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,UAAC,GAAoB,EAAE,GAAqB;IACzD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AACH,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AACrD,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAClG,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9F,GAAG,CAAC,GAAG,CAAC,wBAAwB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3G,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzG,kDAAkD;AAClD,GAAG,CAAC,GAAG,CAAC,8BAAa,CAAC,YAAY,EAAE,CAAC,CAAC;AACtC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;AACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;;;;;;AC/BjB,wC;;;;;;ACAA,oC;;;;;;ACAA,oC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,sCAAmD;AACnD,qCAAuD;AAEvD,+BAA4B;AAC5B,mCAA6B;AAE7B,mGAAmG;AACnG,mGAAmG;AACnG,uCAAuC;AACvC,8DAA8D;AAC7D,MAAc,CAAC,cAAc,GAAG,SAAS,CAAC;AAC3C,6CAA+F;AAC/F,6CAAwD;AACxD,6CAAyE;AAEzE,uCAAoC;AACpC,+CAAiD;AACjD,qDAA4D;AAC5D,wCAAqC;AAYrC,IAAK,kBAIJ;AAJD,WAAK,kBAAkB;IACnB,iCAAW;IACX,mCAAa;IACb,iCAAW;AACf,CAAC,EAJI,kBAAkB,KAAlB,kBAAkB,QAItB;AAED,IAAM,eAAe,GAAG,MAAM,CAAC,CAAC,+BAA+B;AAE/D;IAiBI;QAAA,iBAeC;QA/BO,8BAAyB,GAAmC,EAAE,CAAC;QAiBnE,CAAC,CAAC,KAAK,CAAC,kBAAO,EAAE,UAAC,MAAc,EAAE,SAAiB;YAC/C,IAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAC1D,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;YACnC,IAAM,YAAY,GAAG;gBACjB,SAAS,EAAE,CAAC,SAAS;aACxB,CAAC;YACF,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;YAC9D,IAAM,aAAa,GAAG,IAAI,8BAAa,EAAE,CAAC;YAC1C,KAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,GAAG;gBACxC,aAAa;gBACb,IAAI;gBACJ,MAAM;aACT,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IA9Bc,6BAAqB,GAApC,UAAqC,MAAc;QAC/C,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,iBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,IAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,IAAI,sCAAuB,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,WAAW,CAAC,IAAI,0CAA2B,CAAC,iBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACnF,MAAM,CAAC,WAAW,CACd,IAAI,cAAc,CAAC;YACf,MAAM;SACT,CAAC,CACL,CAAC;QACF,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,MAAM,CAAC;IAClB,CAAC;IAiBM,8BAAY,GAAnB,UAAoB,GAAoB,EAAE,GAAqB;QAA/D,iBAWC;QAVG,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAClD,IAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,kBAAO,EAAE,UAAC,MAAc,EAAE,SAAiB;YACrE,IAAM,aAAa,GAAG,KAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC;YAC9E,MAAM,CAAC;gBACH,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE;gBAC5B,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE;aAC7B,CAAC;QACN,CAAC,CAAC,CAAC;QACH,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC1C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IACM,+BAAa,GAApB,UAAqB,GAAoB,EAAE,GAAqB;QAC5D,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IACM,6BAAW,GAAlB,UAAmB,GAAoB,EAAE,GAAqB;QAC1D,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IACY,mCAAiB,GAA9B,UAA+B,GAAoB,EAAE,GAAqB;;;;4BACtE,qBAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC;;wBAA5D,SAA4D,CAAC;;;;;KAChE;IACY,kCAAgB,GAA7B,UAA8B,GAAoB,EAAE,GAAqB,EAAE,IAA0B;;;;4BACjG,qBAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,GAAG,CAAC;;wBAA3D,SAA2D,CAAC;;;;;KAC/D;IACO,gCAAc,GAAtB,UAAuB,GAAoB,EAAE,GAAqB,EAAE,kBAAsC;QACtG,IAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;QACvC,IAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;QACvC,IAAM,aAAa,GAAG,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,aAAa,CAAC;QAClB,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;YACzB,KAAK,kBAAkB,CAAC,GAAG;gBACvB,aAAa,GAAG,yCAAkB,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;gBACpF,KAAK,CAAC;YACV,KAAK,kBAAkB,CAAC,IAAI,CAAC;YAC7B,KAAK,kBAAkB,CAAC,GAAG;gBACvB,aAAa,GAAG,yCAAkB,CAAC,iBAAiB,CAChD,SAAS,EACT,kBAAkB,EAClB,aAAa,CAAC,MAAM,CACvB,CAAC;gBACF,KAAK,CAAC;YACV;gBACI,MAAM,IAAI,KAAK,CAAC,6BAA2B,kBAAoB,CAAC,CAAC;QACzE,CAAC;QACD,IAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;YACjB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtC,MAAM,CAAC;QACX,CAAC;QACD,gBAAQ,CAAC,GAAG,CAAC,WAAS,SAAS,mBAAc,kBAAkB,oBAAe,SAAW,CAAC,CAAC;QAC3F,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1B,CAAC;IACa,gCAAc,GAA5B,UAA6B,GAAoB,EAAE,GAAqB,EAAE,kBAAsC;;;;;;wBACtG,aAAa,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;wBAClF,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;4BAC/B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;4BAC/C,MAAM,gBAAC;wBACX,CAAC;wBACK,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;wBACpC,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;wBAC/B,qBAAM,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC,kBAAkB,CAAC;;wBAAzF,UAAU,GAAG,SAA4E;wBAC/F,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;4BAC5B,MAAM,IAAI,KAAK,CAAC,6BAA2B,kBAAoB,CAAC,CAAC;wBACrE,CAAC;wBACK,gBAAgB,GAClB,kBAAkB,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC;wBACnF,qBAAM,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC,gBAAgB,CAAC;;wBAAvF,UAAU,GAAG,SAA0E;wBAC7F,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;4BAC5B,MAAM,IAAI,KAAK,CAAC,6BAA2B,kBAAoB,CAAC,CAAC;wBACrE,CAAC;wBACK,gBAAgB,GAAG,eAAM,CAAC,gBAAgB,CAAC,IAAI,iBAAS,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;wBACpF,gBAAgB,GAAG,eAAM,CAAC,gBAAgB,CAAC,IAAI,iBAAS,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;wBACpF,KAAK,GAAU;4BACjB,KAAK,EAAE,iBAAO,CAAC,iBAAiB;4BAChC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS;4BAC3B,QAAQ,EAAE,IAAI,iBAAS,CAAC,CAAC,CAAC;4BAC1B,QAAQ,EAAE,IAAI,iBAAS,CAAC,CAAC,CAAC;4BAC1B,gBAAgB;4BAChB,gBAAgB;4BAChB,iBAAiB,EAAE,UAAU,CAAC,OAAO;4BACrC,iBAAiB,EAAE,UAAU,CAAC,OAAO;4BACrC,IAAI,EAAE,eAAM,CAAC,wBAAwB,EAAE;4BACvC,uBAAuB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE;4BAC7D,YAAY,EAAE,eAAM,CAAC,YAAY;4BACjC,0BAA0B,EAAE,IAAI,iBAAS,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC;yBAC1E,CAAC;wBACI,SAAS,GAAG,eAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;wBAC9B,qBAAM,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,iBAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC;;wBAAxF,SAAS,GAAG,SAA4E;wBACxF,WAAW,gBACV,KAAK,IACR,WAAW,EAAE,SAAS,GACzB,CAAC;wBACI,eAAe,GAAG,eAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;wBACtD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;wBAC5C,gBAAQ,CAAC,GAAG,CAAC,6BAA2B,OAAS,CAAC,CAAC;wBACnD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;;;;KACjC;IACL,cAAC;AAAD,CAAC;AAlIY,0BAAO;;;;;;;ACtCpB,iC;;;;;;ACAA,oD;;;;;;ACAA,iD;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,qCAA2D;AAC3D,+BAA4B;AAE5B,8CAAiD;AAEjD,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC;IAII;QACI,IAAI,CAAC,gBAAgB,GAAG,yBAAyB,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IACM,2BAAG,GAAV,UAAW,SAA8B;QACrC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;IACM,4BAAI,GAAX;QACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IACM,8BAAM,GAAb;QACI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,cAAc,CAAC;IACzC,CAAC;IACM,4BAAI,GAAX;QACI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;YAChD,qBAAa,CAAC,2BAA2B,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;IACO,8BAAM,GAAd;QAAA,iBAgBC;QAfG,IAAI,CAAC,wBAAwB,GAAG,qBAAa,CAAC,yBAAyB,CACnE;;;;;wBACU,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;wBACtC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;4BAC3B,MAAM,gBAAC,OAAO,CAAC,OAAO,EAAE,EAAC;wBAC7B,CAAC;wBACD,qBAAM,SAAS,EAAE;;wBAAjB,SAAiB,CAAC;;;;aACrB,EACD,IAAI,CAAC,gBAAgB,EACrB,UAAC,GAAU;YACP,gBAAQ,CAAC,GAAG,CAAC,qBAAmB,GAAG,WAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAG,CAAC,CAAC;YAChE,gDAAgD;YAChD,8BAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CACJ,CAAC;IACN,CAAC;IACL,oBAAC;AAAD,CAAC;AA5CY,sCAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACR1B,sCAA+B;AAC/B,qCAAkE;AAClE,+BAA4B;AAG5B,uCAAoC;AAGpC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,IAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,IAAM,yBAAyB,GAAG,CAAC,CAAC;AAEvB,0BAAkB,GAAG;IAC9B,iBAAiB,YAAC,gBAAwB,EAAE,IAAU;QAAtD,iBAmBC;QAlBG,MAAM,CAAC;;;;;wBACH,gBAAQ,CAAC,GAAG,CAAC,oBAAkB,gBAAkB,CAAC,CAAC;wBAC/B,qBAAM,iBAAS,CAAY,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,gBAAgB,CAAC;;wBAA/E,WAAW,GAAG,SAAiE;wBAC/E,cAAc,GAAG,IAAI,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC,CAAC;wBACrF,EAAE,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;4BACnD,gBAAQ,CAAC,GAAG,CACR,wCAAsC,cAAc,UAAK,gBAAgB,SAAI,WAAW,MAAG,CAC9F,CAAC;4BACF,MAAM,gBAAC;wBACX,CAAC;wBACK,oBAAoB,GAAG,iBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;wBAClD,qBAAM,oBAAoB,CAAC;gCACtC,IAAI,EAAE,iBAAO,CAAC,iBAAiB;gCAC/B,EAAE,EAAE,gBAAgB;gCACpB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,OAAO,CAAC;6BACpD,CAAC;;wBAJI,MAAM,GAAG,SAIb;wBACF,gBAAQ,CAAC,GAAG,CAAC,UAAQ,qBAAqB,gBAAW,gBAAgB,aAAQ,MAAQ,CAAC,CAAC;;;;aAC1F,CAAC;IACN,CAAC;IACD,iBAAiB,YAAC,gBAAwB,EAAE,WAAmB,EAAE,MAAc;QAA/E,iBA4BC;QA3BG,MAAM,CAAC;;;;;wBACH,gBAAQ,CAAC,GAAG,CAAC,gBAAc,WAAW,SAAI,gBAAkB,CAAC,CAAC;wBACxD,gBAAgB,GAAG,IAAI,iBAAS,CAAC,qBAAqB,CAAC,CAAC;wBAChD,qBAAM,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC,WAAW,CAAC;;wBAA7E,KAAK,GAAG,SAAqE;wBACnF,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;4BACvB,MAAM,IAAI,KAAK,CAAC,6BAA2B,WAAa,CAAC,CAAC;wBAC9D,CAAC;wBACK,cAAc,GAAG,eAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;wBACpD,qBAAM,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC;;wBAA1F,oBAAoB,GAAG,SAAmE;wBAC1F,kBAAkB,GAAG,eAAM,CAAC,gBAAgB,CAC9C,IAAI,iBAAS,CAAC,yBAAyB,CAAC,EACxC,KAAK,CAAC,QAAQ,CACjB,CAAC;wBACF,EAAE,CAAC,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;4BAChE,gBAAQ,CAAC,GAAG,CACR,0CAAwC,kBAAkB,UAAK,gBAAgB,SAAI,oBAAoB,MAAG,CAC7G,CAAC;4BACF,MAAM,gBAAC;wBACX,CAAC;wBACc,qBAAM,MAAM,CAAC,KAAK,CAAC,aAAa,CAC3C,KAAK,CAAC,OAAO,EACb,iBAAO,CAAC,iBAAiB,EACzB,gBAAgB,EAChB,cAAc,CACjB;;wBALK,MAAM,GAAG,SAKd;wBACD,gBAAQ,CAAC,GAAG,CAAC,UAAQ,gBAAgB,gBAAW,gBAAgB,aAAQ,MAAQ,CAAC,CAAC;;;;aACrF,CAAC;IACN,CAAC;CACJ,CAAC;;;;;;;;;;AC/DF,qCAAgD;AAEhD,+BAA4B;AAG5B,wCAAqC;AAErC,IAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,QAAQ;AAE1B,4BAAoB,GAAG;IAChC,SAAS,YAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;QACrD,IAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;QAC9C,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAY,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;YAC/E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;YAClD,MAAM,CAAC;QACX,CAAC;QACD,IAAM,yBAAyB,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;QACjE,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,yBAAyB,CAAC;QACjD,IAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACpE,IAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAO,EAAE,SAAS,CAAC,CAAC;QACjD,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YAChC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAC/C,MAAM,CAAC;QACX,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,IAAI,EAAE,CAAC;IACX,CAAC;CACJ,CAAC","file":"server.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b91d2cee364b5e101d43","module.exports = require(\"@0xproject/utils\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"@0xproject/utils\"\n// module id = 0\n// module chunks = 0","export const configs = {\n DISPENSER_ADDRESS: (process.env.DISPENSER_ADDRESS as string).toLowerCase(),\n DISPENSER_PRIVATE_KEY: process.env.DISPENSER_PRIVATE_KEY,\n ENVIRONMENT: process.env.FAUCET_ENVIRONMENT,\n INFURA_API_KEY: process.env.INFURA_API_KEY,\n ROLLBAR_ACCESS_KEY: process.env.FAUCET_ROLLBAR_ACCESS_KEY,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/configs.ts","module.exports = require(\"lodash\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"lodash\"\n// module id = 2\n// module chunks = 0","import { logUtils } from '@0xproject/utils';\nimport * as express from 'express';\nimport rollbar = require('rollbar');\n\nimport { configs } from './configs';\n\nexport const errorReporter = {\n setup() {\n rollbar.init(configs.ROLLBAR_ACCESS_KEY, {\n environment: configs.ENVIRONMENT,\n });\n rollbar.handleUncaughtExceptions(configs.ROLLBAR_ACCESS_KEY);\n process.on('unhandledRejection', async (err: Error) => {\n logUtils.log(`Uncaught exception ${err}. Stack: ${err.stack}`);\n await this.reportAsync(err);\n process.exit(1);\n });\n },\n async reportAsync(err: Error, req?: express.Request): Promise {\n if (configs.ENVIRONMENT === 'development') {\n return; // Do not log development environment errors\n }\n return new Promise((resolve, reject) => {\n rollbar.handleError(err, req, (rollbarErr: Error) => {\n if (rollbarErr) {\n logUtils.log(`Error reporting to rollbar, ignoring: ${rollbarErr}`);\n reject(rollbarErr);\n } else {\n resolve();\n }\n });\n });\n },\n errorHandler() {\n return rollbar.errorHandler(configs.ROLLBAR_ACCESS_KEY);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/error_reporter.ts","module.exports = require(\"0x.js\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"0x.js\"\n// module id = 4\n// module chunks = 0","import { configs } from './configs';\n\nconst productionRpcUrls = {\n '3': `https://ropsten.infura.io/${configs.INFURA_API_KEY}`,\n '4': `https://rinkeby.infura.io/${configs.INFURA_API_KEY}`,\n '42': `https://kovan.infura.io/${configs.INFURA_API_KEY}`,\n};\n\nconst developmentRpcUrls = {\n '50': 'http://127.0.0.1:8545',\n};\n\nexport const rpcUrls = configs.ENVIRONMENT === 'development' ? developmentRpcUrls : productionRpcUrls;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/rpc_urls.ts","import * as bodyParser from 'body-parser';\nimport * as express from 'express';\n\nimport { errorReporter } from './error_reporter';\nimport { Handler } from './handler';\nimport { parameterTransformer } from './parameter_transformer';\n\n// Setup the errorReporter to catch uncaught exceptions and unhandled rejections\nerrorReporter.setup();\n\nconst app = express();\napp.use(bodyParser.json()); // for parsing application/json\napp.use((req, res, next) => {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');\n next();\n});\n\nconst handler = new Handler();\napp.get('/ping', (req: express.Request, res: express.Response) => {\n res.status(200).send('pong');\n});\napp.get('/info', handler.getQueueInfo.bind(handler));\napp.get('/ether/:recipient', parameterTransformer.transform, handler.dispenseEther.bind(handler));\napp.get('/zrx/:recipient', parameterTransformer.transform, handler.dispenseZRX.bind(handler));\napp.get('/order/weth/:recipient', parameterTransformer.transform, handler.dispenseWETHOrder.bind(handler));\napp.get('/order/zrx/:recipient', parameterTransformer.transform, handler.dispenseZRXOrder.bind(handler));\n\n// Log to rollbar any errors unhandled by handlers\napp.use(errorReporter.errorHandler());\nconst port = process.env.PORT || 3000;\napp.listen(port);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/server.ts","module.exports = require(\"body-parser\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"body-parser\"\n// module id = 8\n// module chunks = 0","module.exports = require(\"express\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"express\"\n// module id = 9\n// module chunks = 0","module.exports = require(\"rollbar\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"rollbar\"\n// module id = 10\n// module chunks = 0","import { Order, SignedOrder, ZeroEx } from '0x.js';\nimport { BigNumber, logUtils } from '@0xproject/utils';\nimport * as express from 'express';\nimport * as _ from 'lodash';\nimport * as Web3 from 'web3';\n\n// HACK: web3 injects XMLHttpRequest into the global scope and ProviderEngine checks XMLHttpRequest\n// to know whether it is running in a browser or node environment. We need it to be undefined since\n// we are not running in a browser env.\n// Filed issue: https://github.com/ethereum/web3.js/issues/844\n(global as any).XMLHttpRequest = undefined;\nimport { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders';\nimport ProviderEngine = require('web3-provider-engine');\nimport RpcSubprovider = require('web3-provider-engine/subproviders/rpc');\n\nimport { configs } from './configs';\nimport { DispatchQueue } from './dispatch_queue';\nimport { dispenseAssetTasks } from './dispense_asset_tasks';\nimport { rpcUrls } from './rpc_urls';\n\ninterface NetworkConfig {\n dispatchQueue: DispatchQueue;\n web3: Web3;\n zeroEx: ZeroEx;\n}\n\ninterface ItemByNetworkId {\n [networkId: string]: T;\n}\n\nenum RequestedAssetType {\n ETH = 'ETH',\n WETH = 'WETH',\n ZRX = 'ZRX',\n}\n\nconst FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable\n\nexport class Handler {\n private _networkConfigByNetworkId: ItemByNetworkId = {};\n private static _createProviderEngine(rpcUrl: string) {\n if (_.isUndefined(configs.DISPENSER_PRIVATE_KEY)) {\n throw new Error('Dispenser Private key not found');\n }\n const engine = new ProviderEngine();\n engine.addProvider(new NonceTrackerSubprovider());\n engine.addProvider(new PrivateKeyWalletSubprovider(configs.DISPENSER_PRIVATE_KEY));\n engine.addProvider(\n new RpcSubprovider({\n rpcUrl,\n }),\n );\n engine.start();\n return engine;\n }\n constructor() {\n _.forIn(rpcUrls, (rpcUrl: string, networkId: string) => {\n const providerObj = Handler._createProviderEngine(rpcUrl);\n const web3 = new Web3(providerObj);\n const zeroExConfig = {\n networkId: +networkId,\n };\n const zeroEx = new ZeroEx(web3.currentProvider, zeroExConfig);\n const dispatchQueue = new DispatchQueue();\n this._networkConfigByNetworkId[networkId] = {\n dispatchQueue,\n web3,\n zeroEx,\n };\n });\n }\n public getQueueInfo(req: express.Request, res: express.Response) {\n res.setHeader('Content-Type', 'application/json');\n const queueInfo = _.mapValues(rpcUrls, (rpcUrl: string, networkId: string) => {\n const dispatchQueue = this._networkConfigByNetworkId[networkId].dispatchQueue;\n return {\n full: dispatchQueue.isFull(),\n size: dispatchQueue.size(),\n };\n });\n const payload = JSON.stringify(queueInfo);\n res.status(200).send(payload);\n }\n public dispenseEther(req: express.Request, res: express.Response) {\n this._dispenseAsset(req, res, RequestedAssetType.ETH);\n }\n public dispenseZRX(req: express.Request, res: express.Response) {\n this._dispenseAsset(req, res, RequestedAssetType.ZRX);\n }\n public async dispenseWETHOrder(req: express.Request, res: express.Response) {\n await this._dispenseOrder(req, res, RequestedAssetType.WETH);\n }\n public async dispenseZRXOrder(req: express.Request, res: express.Response, next: express.NextFunction) {\n await this._dispenseOrder(req, res, RequestedAssetType.ZRX);\n }\n private _dispenseAsset(req: express.Request, res: express.Response, requestedAssetType: RequestedAssetType) {\n const networkId = req.params.networkId;\n const recipient = req.params.recipient;\n const networkConfig = this._networkConfigByNetworkId[networkId];\n let dispenserTask;\n switch (requestedAssetType) {\n case RequestedAssetType.ETH:\n dispenserTask = dispenseAssetTasks.dispenseEtherTask(recipient, networkConfig.web3);\n break;\n case RequestedAssetType.WETH:\n case RequestedAssetType.ZRX:\n dispenserTask = dispenseAssetTasks.dispenseTokenTask(\n recipient,\n requestedAssetType,\n networkConfig.zeroEx,\n );\n break;\n default:\n throw new Error(`Unsupported asset type: ${requestedAssetType}`);\n }\n const didAddToQueue = networkConfig.dispatchQueue.add(dispenserTask);\n if (!didAddToQueue) {\n res.status(503).send('QUEUE_IS_FULL');\n return;\n }\n logUtils.log(`Added ${recipient} to queue: ${requestedAssetType} networkId: ${networkId}`);\n res.status(200).end();\n }\n private async _dispenseOrder(req: express.Request, res: express.Response, requestedAssetType: RequestedAssetType) {\n const networkConfig = _.get(this._networkConfigByNetworkId, req.params.networkId);\n if (_.isUndefined(networkConfig)) {\n res.status(400).send('UNSUPPORTED_NETWORK_ID');\n return;\n }\n const zeroEx = networkConfig.zeroEx;\n res.setHeader('Content-Type', 'application/json');\n const makerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType);\n if (_.isUndefined(makerToken)) {\n throw new Error(`Unsupported asset type: ${requestedAssetType}`);\n }\n const takerTokenSymbol =\n requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH;\n const takerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol);\n if (_.isUndefined(takerToken)) {\n throw new Error(`Unsupported asset type: ${requestedAssetType}`);\n }\n const makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), makerToken.decimals);\n const takerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), takerToken.decimals);\n const order: Order = {\n maker: configs.DISPENSER_ADDRESS,\n taker: req.params.recipient,\n makerFee: new BigNumber(0),\n takerFee: new BigNumber(0),\n makerTokenAmount,\n takerTokenAmount,\n makerTokenAddress: makerToken.address,\n takerTokenAddress: takerToken.address,\n salt: ZeroEx.generatePseudoRandomSalt(),\n exchangeContractAddress: zeroEx.exchange.getContractAddress(),\n feeRecipient: ZeroEx.NULL_ADDRESS,\n expirationUnixTimestampSec: new BigNumber(Date.now() + FIVE_DAYS_IN_MS),\n };\n const orderHash = ZeroEx.getOrderHashHex(order);\n const signature = await zeroEx.signOrderHashAsync(orderHash, configs.DISPENSER_ADDRESS, false);\n const signedOrder = {\n ...order,\n ecSignature: signature,\n };\n const signedOrderHash = ZeroEx.getOrderHashHex(signedOrder);\n const payload = JSON.stringify(signedOrder);\n logUtils.log(`Dispensed signed order: ${payload}`);\n res.status(200).send(payload);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/handler.ts","module.exports = require(\"web3\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"web3\"\n// module id = 12\n// module chunks = 0","module.exports = require(\"@0xproject/subproviders\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"@0xproject/subproviders\"\n// module id = 13\n// module chunks = 0","module.exports = require(\"web3-provider-engine\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"web3-provider-engine\"\n// module id = 14\n// module chunks = 0","module.exports = require(\"web3-provider-engine/subproviders/rpc\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"web3-provider-engine/subproviders/rpc\"\n// module id = 15\n// module chunks = 0","import { intervalUtils, logUtils } from '@0xproject/utils';\nimport * as _ from 'lodash';\n\nimport { errorReporter } from './error_reporter';\n\nconst MAX_QUEUE_SIZE = 500;\nconst DEFAULT_QUEUE_INTERVAL_MS = 1000;\n\nexport class DispatchQueue {\n private _queueIntervalMs: number;\n private _queue: Array<() => Promise>;\n private _queueIntervalIdIfExists?: NodeJS.Timer;\n constructor() {\n this._queueIntervalMs = DEFAULT_QUEUE_INTERVAL_MS;\n this._queue = [];\n this._start();\n }\n public add(taskAsync: () => Promise): boolean {\n if (this.isFull()) {\n return false;\n }\n this._queue.push(taskAsync);\n return true;\n }\n public size(): number {\n return this._queue.length;\n }\n public isFull(): boolean {\n return this.size() >= MAX_QUEUE_SIZE;\n }\n public stop() {\n if (!_.isUndefined(this._queueIntervalIdIfExists)) {\n intervalUtils.clearAsyncExcludingInterval(this._queueIntervalIdIfExists);\n }\n }\n private _start() {\n this._queueIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval(\n async () => {\n const taskAsync = this._queue.shift();\n if (_.isUndefined(taskAsync)) {\n return Promise.resolve();\n }\n await taskAsync();\n },\n this._queueIntervalMs,\n (err: Error) => {\n logUtils.log(`Unexpected err: ${err} - ${JSON.stringify(err)}`);\n // tslint:disable-next-line:no-floating-promises\n errorReporter.reportAsync(err);\n },\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/dispatch_queue.ts","import { ZeroEx } from '0x.js';\nimport { BigNumber, logUtils, promisify } from '@0xproject/utils';\nimport * as _ from 'lodash';\nimport * as Web3 from 'web3';\n\nimport { configs } from './configs';\nimport { errorReporter } from './error_reporter';\n\nconst DISPENSE_AMOUNT_ETHER = 0.1;\nconst DISPENSE_AMOUNT_TOKEN = 0.1;\nconst DISPENSE_MAX_AMOUNT_TOKEN = 2;\nconst DISPENSE_MAX_AMOUNT_ETHER = 2;\n\nexport const dispenseAssetTasks = {\n dispenseEtherTask(recipientAddress: string, web3: Web3) {\n return async () => {\n logUtils.log(`Processing ETH ${recipientAddress}`);\n const userBalance = await promisify(web3.eth.getBalance)(recipientAddress);\n const maxAmountInWei = new BigNumber(web3.toWei(DISPENSE_MAX_AMOUNT_ETHER, 'ether'));\n if (userBalance.greaterThanOrEqualTo(maxAmountInWei)) {\n logUtils.log(\n `User exceeded ETH balance maximum (${maxAmountInWei}) ${recipientAddress} ${userBalance} `,\n );\n return;\n }\n const sendTransactionAsync = promisify(web3.eth.sendTransaction);\n const txHash = await sendTransactionAsync({\n from: configs.DISPENSER_ADDRESS,\n to: recipientAddress,\n value: web3.toWei(DISPENSE_AMOUNT_ETHER, 'ether'),\n });\n logUtils.log(`Sent ${DISPENSE_AMOUNT_ETHER} ETH to ${recipientAddress} tx: ${txHash}`);\n };\n },\n dispenseTokenTask(recipientAddress: string, tokenSymbol: string, zeroEx: ZeroEx) {\n return async () => {\n logUtils.log(`Processing ${tokenSymbol} ${recipientAddress}`);\n const amountToDispense = new BigNumber(DISPENSE_AMOUNT_TOKEN);\n const token = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(tokenSymbol);\n if (_.isUndefined(token)) {\n throw new Error(`Unsupported asset type: ${tokenSymbol}`);\n }\n const baseUnitAmount = ZeroEx.toBaseUnitAmount(amountToDispense, token.decimals);\n const userBalanceBaseUnits = await zeroEx.token.getBalanceAsync(token.address, recipientAddress);\n const maxAmountBaseUnits = ZeroEx.toBaseUnitAmount(\n new BigNumber(DISPENSE_MAX_AMOUNT_TOKEN),\n token.decimals,\n );\n if (userBalanceBaseUnits.greaterThanOrEqualTo(maxAmountBaseUnits)) {\n logUtils.log(\n `User exceeded token balance maximum (${maxAmountBaseUnits}) ${recipientAddress} ${userBalanceBaseUnits} `,\n );\n return;\n }\n const txHash = await zeroEx.token.transferAsync(\n token.address,\n configs.DISPENSER_ADDRESS,\n recipientAddress,\n baseUnitAmount,\n );\n logUtils.log(`Sent ${amountToDispense} ZRX to ${recipientAddress} tx: ${txHash}`);\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/dispense_asset_tasks.ts","import { addressUtils } from '@0xproject/utils';\nimport { NextFunction, Request, Response } from 'express';\nimport * as _ from 'lodash';\n\nimport { configs } from './configs';\nimport { rpcUrls } from './rpc_urls';\n\nconst DEFAULT_NETWORK_ID = 42; // kovan\n\nexport const parameterTransformer = {\n transform(req: Request, res: Response, next: NextFunction) {\n const recipientAddress = req.params.recipient;\n if (_.isUndefined(recipientAddress) || !addressUtils.isAddress(recipientAddress)) {\n res.status(400).send('INVALID_RECIPIENT_ADDRESS');\n return;\n }\n const lowerCaseRecipientAddress = recipientAddress.toLowerCase();\n req.params.recipient = lowerCaseRecipientAddress;\n const networkId = _.get(req.query, 'networkId', DEFAULT_NETWORK_ID);\n const rpcUrlIfExists = _.get(rpcUrls, networkId);\n if (_.isUndefined(rpcUrlIfExists)) {\n res.status(400).send('UNSUPPORTED_NETWORK_ID');\n return;\n }\n req.params.networkId = networkId;\n next();\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/parameter_transformer.ts"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index afcfd862c..aef14fead 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -2,6 +2,10 @@ { "version": "0.7.0", "changes": [ + { + "note": "Make OpCode type an enum", + "pr": 589 + }, { "note": "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index d3c7da7b9..f447bdd1c 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "0.7.0", + "changes": [ + { + "note": "Add logUtils.warn", + "pr": 589 + } + ] + }, { "timestamp": 1525477860, "version": "0.6.1", -- cgit v1.2.3 From 1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 15:14:36 +0200 Subject: Remove web3Factory.create and remove dev-tools dependency on sol-cov --- packages/0x.js/test/utils/web3_wrapper.ts | 5 +- packages/contract-wrappers/test/artifacts_test.ts | 4 +- .../contract-wrappers/test/utils/web3_wrapper.ts | 5 +- packages/contracts/package.json | 2 + packages/contracts/src/utils/web3_wrapper.ts | 12 +- packages/contracts/test/global_hooks.ts | 4 +- packages/contracts/test/utils/coverage.ts | 21 + packages/dev-utils/package.json | 1 - packages/dev-utils/src/coverage.ts | 22 - packages/dev-utils/src/index.ts | 1 - packages/dev-utils/src/web3_factory.ts | 20 +- packages/metacoin/test/utils/web3_wrapper.ts | 11 +- packages/migrations/package.json | 2 +- packages/migrations/src/migrate.ts | 3 +- packages/order-utils/test/utils/web3_wrapper.ts | 5 +- packages/order-watcher/test/utils/web3_wrapper.ts | 5 +- packages/sol-compiler/test/util/provider.ts | 3 +- packages/sol-cov/src/coverage_subprovider.ts | 2 +- packages/sol-cov/src/trace.json | 3227 ++++++++++++++++++++ packages/sol-cov/src/trace.ts | 2 +- packages/sol-cov/test/trace_test.ts | 2 +- packages/subproviders/src/index.ts | 1 + .../subproviders/src/utils/subprovider_utils.ts | 13 + packages/testnet-faucets/bin/server.js | 780 ----- packages/testnet-faucets/bin/server.js.map | 1 - .../types/web3-provider-engine/index.d.ts | 18 +- 26 files changed, 3310 insertions(+), 862 deletions(-) create mode 100644 packages/contracts/test/utils/coverage.ts delete mode 100644 packages/dev-utils/src/coverage.ts create mode 100644 packages/sol-cov/src/trace.json create mode 100644 packages/subproviders/src/utils/subprovider_utils.ts delete mode 100644 packages/testnet-faucets/bin/server.js delete mode 100644 packages/testnet-faucets/bin/server.js.map diff --git a/packages/0x.js/test/utils/web3_wrapper.ts b/packages/0x.js/test/utils/web3_wrapper.ts index b0ccfa546..71a0dc1c2 100644 --- a/packages/0x.js/test/utils/web3_wrapper.ts +++ b/packages/0x.js/test/utils/web3_wrapper.ts @@ -2,8 +2,7 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -const web3 = web3Factory.create({ shouldUseInProcessGanache: true }); -const provider: Provider = web3.currentProvider; -const web3Wrapper = new Web3Wrapper(web3.currentProvider); +const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true }); +const web3Wrapper = new Web3Wrapper(provider); export { provider, web3Wrapper }; diff --git a/packages/contract-wrappers/test/artifacts_test.ts b/packages/contract-wrappers/test/artifacts_test.ts index 446b8f9d1..eaaa89c48 100644 --- a/packages/contract-wrappers/test/artifacts_test.ts +++ b/packages/contract-wrappers/test/artifacts_test.ts @@ -15,7 +15,7 @@ const TIMEOUT = 10000; describe('Artifacts', () => { describe('contracts are deployed on kovan', () => { const kovanRpcUrl = constants.KOVAN_RPC_URL; - const provider = web3Factory.create({ rpcUrl: kovanRpcUrl }).currentProvider; + const provider = web3Factory.getRpcProvider({ rpcUrl: kovanRpcUrl }); const config = { networkId: constants.KOVAN_NETWORK_ID, }; @@ -32,7 +32,7 @@ describe('Artifacts', () => { }); describe('contracts are deployed on ropsten', () => { const ropstenRpcUrl = constants.ROPSTEN_RPC_URL; - const provider = web3Factory.create({ rpcUrl: ropstenRpcUrl }).currentProvider; + const provider = web3Factory.getRpcProvider({ rpcUrl: ropstenRpcUrl }); const config = { networkId: constants.ROPSTEN_NETWORK_ID, }; diff --git a/packages/contract-wrappers/test/utils/web3_wrapper.ts b/packages/contract-wrappers/test/utils/web3_wrapper.ts index b0ccfa546..71a0dc1c2 100644 --- a/packages/contract-wrappers/test/utils/web3_wrapper.ts +++ b/packages/contract-wrappers/test/utils/web3_wrapper.ts @@ -2,8 +2,7 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -const web3 = web3Factory.create({ shouldUseInProcessGanache: true }); -const provider: Provider = web3.currentProvider; -const web3Wrapper = new Web3Wrapper(web3.currentProvider); +const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true }); +const web3Wrapper = new Web3Wrapper(provider); export { provider, web3Wrapper }; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 9c7142cdb..f17c64a6f 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -44,6 +44,8 @@ "devDependencies": { "@0xproject/abi-gen": "^0.2.13", "@0xproject/dev-utils": "^0.4.1", + "@0xproject/subproviders": "^0.10.1", + "@0xproject/sol-cov": "^0.0.10", "@0xproject/tslint-config": "^0.4.17", "@types/lodash": "4.14.104", "@types/node": "^8.0.53", diff --git a/packages/contracts/src/utils/web3_wrapper.ts b/packages/contracts/src/utils/web3_wrapper.ts index ed1c488a2..5d3d9f7c9 100644 --- a/packages/contracts/src/utils/web3_wrapper.ts +++ b/packages/contracts/src/utils/web3_wrapper.ts @@ -1,12 +1,18 @@ -import { devConstants, web3Factory } from '@0xproject/dev-utils'; +import { devConstants, env, EnvVars, web3Factory } from '@0xproject/dev-utils'; +import { prependSubprovider } from '@0xproject/subproviders'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { coverage } from './coverage'; + export const txDefaults = { from: devConstants.TESTRPC_FIRST_ADDRESS, gas: devConstants.GAS_ESTIMATE, }; const providerConfigs = { shouldUseInProcessGanache: true }; -export const web3 = web3Factory.create(providerConfigs); -export const provider = web3.currentProvider; +export const provider = web3Factory.getRpcProvider(providerConfigs); +const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); +if (isCoverageEnabled) { + prependSubprovider(provider, coverage.getCoverageSubproviderSingleton()); +} export const web3Wrapper = new Web3Wrapper(provider); diff --git a/packages/contracts/test/global_hooks.ts b/packages/contracts/test/global_hooks.ts index 089521d94..509dc6837 100644 --- a/packages/contracts/test/global_hooks.ts +++ b/packages/contracts/test/global_hooks.ts @@ -1,4 +1,6 @@ -import { coverage, env, EnvVars } from '@0xproject/dev-utils'; +import { env, EnvVars } from '@0xproject/dev-utils'; + +import { coverage } from './utils/coverage'; after('generate coverage report', async () => { if (env.parseBoolean(EnvVars.SolidityCoverage)) { diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts new file mode 100644 index 000000000..e3c5be428 --- /dev/null +++ b/packages/contracts/test/utils/coverage.ts @@ -0,0 +1,21 @@ +import { devConstants } from '@0xproject/dev-utils'; +import { CoverageSubprovider, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; +import * as fs from 'fs'; +import * as _ from 'lodash'; + +let coverageSubprovider: CoverageSubprovider; + +export const coverage = { + getCoverageSubproviderSingleton(): CoverageSubprovider { + if (_.isUndefined(coverageSubprovider)) { + coverageSubprovider = coverage._getCoverageSubprovider(); + } + return coverageSubprovider; + }, + _getCoverageSubprovider(): CoverageSubprovider { + const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; + const config = JSON.parse(fs.readFileSync('compiler.json').toString()); + const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); + return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); + }, +}; diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 49964c82a..9dd3750c5 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -44,7 +44,6 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/sol-cov": "^0.0.10", "@0xproject/subproviders": "^0.10.1", "@0xproject/types": "^0.6.3", "@0xproject/typescript-typings": "^0.3.1", diff --git a/packages/dev-utils/src/coverage.ts b/packages/dev-utils/src/coverage.ts deleted file mode 100644 index caf04672f..000000000 --- a/packages/dev-utils/src/coverage.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { CoverageSubprovider, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; -import * as _ from 'lodash'; - -import { constants } from './constants'; - -let coverageSubprovider: CoverageSubprovider; - -export const coverage = { - getCoverageSubproviderSingleton(): CoverageSubprovider { - if (_.isUndefined(coverageSubprovider)) { - coverageSubprovider = coverage._getCoverageSubprovider(); - } - return coverageSubprovider; - }, - _getCoverageSubprovider(): CoverageSubprovider { - const artifactsPath = '../migrations/artifacts/1.0.0'; - const contractsPath = 'src/contracts'; - const defaultFromAddress = constants.TESTRPC_FIRST_ADDRESS; - const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(artifactsPath, contractsPath); - return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); - }, -}; diff --git a/packages/dev-utils/src/index.ts b/packages/dev-utils/src/index.ts index 9124f3e28..d4c19f1bf 100644 --- a/packages/dev-utils/src/index.ts +++ b/packages/dev-utils/src/index.ts @@ -1,6 +1,5 @@ export { BlockchainLifecycle } from './blockchain_lifecycle'; export { web3Factory } from './web3_factory'; export { constants as devConstants } from './constants'; -export { coverage } from './coverage'; export { env, EnvVars } from './env'; export { callbackErrorReporter } from './callback_error_reporter'; diff --git a/packages/dev-utils/src/web3_factory.ts b/packages/dev-utils/src/web3_factory.ts index 4cd343c44..5b32d3930 100644 --- a/packages/dev-utils/src/web3_factory.ts +++ b/packages/dev-utils/src/web3_factory.ts @@ -13,16 +13,8 @@ import * as _ from 'lodash'; import * as process from 'process'; import { constants } from './constants'; -import { coverage } from './coverage'; import { env, EnvVars } from './env'; -// HACK: web3 leaks XMLHttpRequest into the global scope and causes requests to hang -// because they are using the wrong XHR package. -// importing web3 after subproviders fixes this issue -// Filed issue: https://github.com/ethereum/web3.js/issues/844 -// tslint:disable-next-line:ordered-imports -import * as Web3 from 'web3'; - export interface Web3Config { hasAddresses?: boolean; // default: true shouldUseInProcessGanache?: boolean; // default: false @@ -30,18 +22,8 @@ export interface Web3Config { } export const web3Factory = { - create(config: Web3Config = {}): Web3 { - const provider = this.getRpcProvider(config); - const web3 = new Web3(); - web3.setProvider(provider); - return web3; - }, - getRpcProvider(config: Web3Config = {}): Provider { + getRpcProvider(config: Web3Config = {}): ProviderEngine { const provider = new ProviderEngine(); - const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); - if (isCoverageEnabled) { - provider.addProvider(coverage.getCoverageSubproviderSingleton()); - } const hasAddresses = _.isUndefined(config.hasAddresses) || config.hasAddresses; if (!hasAddresses) { provider.addProvider(new EmptyWalletSubprovider()); diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts index b4bb61f09..9f6b155fc 100644 --- a/packages/metacoin/test/utils/web3_wrapper.ts +++ b/packages/metacoin/test/utils/web3_wrapper.ts @@ -1,5 +1,5 @@ import { env, EnvVars } from '@0xproject/dev-utils'; -import { GanacheSubprovider } from '@0xproject/subproviders'; +import { GanacheSubprovider, prependSubprovider } from '@0xproject/subproviders'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -9,10 +9,6 @@ import { config } from './config'; import { coverage } from './coverage'; export const provider = new ProviderEngine(); -const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); -if (isCoverageEnabled) { - provider.addProvider(coverage.getCoverageSubproviderSingleton()); -} provider.addProvider( new GanacheSubprovider({ logger: { @@ -27,4 +23,9 @@ provider.addProvider( ); provider.start(); +const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); +if (isCoverageEnabled) { + prependSubprovider(provider, coverage.getCoverageSubproviderSingleton()); +} + export const web3Wrapper = new Web3Wrapper(provider); diff --git a/packages/migrations/package.json b/packages/migrations/package.json index d9e68caaf..61dfc5de6 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -9,7 +9,7 @@ "types": "lib/index.d.ts", "scripts": { "watch": "tsc -w", - "prebuild": "run-s clean compile copy_artifacts generate_contract_wrappers", + "prebuild": "run-s clean copy_artifacts generate_contract_wrappers", "copy_artifacts": "copyfiles 'artifacts/1.0.0/**/*' ./lib", "build": "tsc", "clean": "shx rm -rf lib src/contract_wrappers", diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index b00ba698f..1230f376e 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -11,8 +11,7 @@ import { runMigrationsAsync } from './migration'; from: devConstants.TESTRPC_FIRST_ADDRESS, }; const providerConfigs = { shouldUseInProcessGanache: false }; - const web3 = web3Factory.create(providerConfigs); - const provider = web3.currentProvider; + const provider: Provider = web3Factory.getRpcProvider(providerConfigs); const artifactsDir = 'artifacts/1.0.0'; await runMigrationsAsync(provider, artifactsDir, txDefaults); process.exit(0); diff --git a/packages/order-utils/test/utils/web3_wrapper.ts b/packages/order-utils/test/utils/web3_wrapper.ts index b0ccfa546..71a0dc1c2 100644 --- a/packages/order-utils/test/utils/web3_wrapper.ts +++ b/packages/order-utils/test/utils/web3_wrapper.ts @@ -2,8 +2,7 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -const web3 = web3Factory.create({ shouldUseInProcessGanache: true }); -const provider: Provider = web3.currentProvider; -const web3Wrapper = new Web3Wrapper(web3.currentProvider); +const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true }); +const web3Wrapper = new Web3Wrapper(provider); export { provider, web3Wrapper }; diff --git a/packages/order-watcher/test/utils/web3_wrapper.ts b/packages/order-watcher/test/utils/web3_wrapper.ts index b0ccfa546..71a0dc1c2 100644 --- a/packages/order-watcher/test/utils/web3_wrapper.ts +++ b/packages/order-watcher/test/utils/web3_wrapper.ts @@ -2,8 +2,7 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -const web3 = web3Factory.create({ shouldUseInProcessGanache: true }); -const provider: Provider = web3.currentProvider; -const web3Wrapper = new Web3Wrapper(web3.currentProvider); +const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true }); +const web3Wrapper = new Web3Wrapper(provider); export { provider, web3Wrapper }; diff --git a/packages/sol-compiler/test/util/provider.ts b/packages/sol-compiler/test/util/provider.ts index e0fcb362a..2bd178129 100644 --- a/packages/sol-compiler/test/util/provider.ts +++ b/packages/sol-compiler/test/util/provider.ts @@ -3,7 +3,6 @@ import { Provider } from '@0xproject/types'; import * as Web3 from 'web3'; const providerConfigs = { shouldUseInProcessGanache: true }; -const web3Instance = web3Factory.create(providerConfigs); -const provider: Provider = web3Instance.currentProvider; +const provider: Provider = web3Factory.getRpcProvider(providerConfigs); export { provider }; diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index f421a17fd..addad5e8f 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -118,7 +118,7 @@ export class CoverageSubprovider extends Subprovider { private async _recordTxTraceAsync(address: string, data: string | undefined, txHash: string): Promise { let payload = { method: 'debug_traceTransaction', - params: [txHash, { disableMemory: true, disableStack: true, disableStorage: true }], // TODO For now testrpc just ignores those parameters https://github.com/trufflesuite/ganache-cli/issues/489 + params: [txHash, { disableMemory: true, disableStack: false, disableStorage: true }], }; const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); const trace: TransactionTrace = jsonRPCResponsePayload.result; diff --git a/packages/sol-cov/src/trace.json b/packages/sol-cov/src/trace.json new file mode 100644 index 000000000..77ec20a72 --- /dev/null +++ b/packages/sol-cov/src/trace.json @@ -0,0 +1,3227 @@ +[ + { + "depth": 0, + "error": "", + "gas": 21216, + "gasCost": 21784, + "memory": null, + "op": "PUSH1", + "pc": 0, + "stack": [], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21213, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2, + "stack": ["0000000000000000000000000000000000000000000000000000000000000080"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21210, + "gasCost": 3, + "memory": null, + "op": "MSTORE", + "pc": 4, + "stack": [ + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21198, + "gasCost": 12, + "memory": null, + "op": "PUSH1", + "pc": 5, + "stack": [], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21195, + "gasCost": 3, + "memory": null, + "op": "CALLDATASIZE", + "pc": 7, + "stack": ["0000000000000000000000000000000000000000000000000000000000000004"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21193, + "gasCost": 2, + "memory": null, + "op": "LT", + "pc": 8, + "stack": [ + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21190, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 9, + "stack": ["0000000000000000000000000000000000000000000000000000000000000000"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21187, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 12, + "stack": [ + "0000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000af" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21177, + "gasCost": 10, + "memory": null, + "op": "PUSH1", + "pc": 13, + "stack": [], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21174, + "gasCost": 3, + "memory": null, + "op": "CALLDATALOAD", + "pc": 15, + "stack": ["0000000000000000000000000000000000000000000000000000000000000000"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21171, + "gasCost": 3, + "memory": null, + "op": "PUSH29", + "pc": 16, + "stack": ["2e1a7d4d0000000000000000000000000000000000000000000000000de0b6b3"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21168, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 46, + "stack": [ + "2e1a7d4d0000000000000000000000000000000000000000000000000de0b6b3", + "0000000100000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21165, + "gasCost": 3, + "memory": null, + "op": "DIV", + "pc": 47, + "stack": [ + "0000000100000000000000000000000000000000000000000000000000000000", + "2e1a7d4d0000000000000000000000000000000000000000000000000de0b6b3" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21160, + "gasCost": 5, + "memory": null, + "op": "PUSH4", + "pc": 48, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21157, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 53, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "00000000000000000000000000000000000000000000000000000000ffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21154, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 54, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21151, + "gasCost": 3, + "memory": null, + "op": "PUSH4", + "pc": 55, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21148, + "gasCost": 3, + "memory": null, + "op": "EQ", + "pc": 60, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000006fdde03" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21145, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 61, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21142, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 64, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000b9" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21132, + "gasCost": 10, + "memory": null, + "op": "DUP1", + "pc": 65, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21129, + "gasCost": 3, + "memory": null, + "op": "PUSH4", + "pc": 66, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21126, + "gasCost": 3, + "memory": null, + "op": "EQ", + "pc": 71, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "00000000000000000000000000000000000000000000000000000000095ea7b3" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21123, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 72, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21120, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 75, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000149" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21110, + "gasCost": 10, + "memory": null, + "op": "DUP1", + "pc": 76, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21107, + "gasCost": 3, + "memory": null, + "op": "PUSH4", + "pc": 77, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21104, + "gasCost": 3, + "memory": null, + "op": "EQ", + "pc": 82, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000018160ddd" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21101, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 83, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21098, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 86, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000001ae" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21088, + "gasCost": 10, + "memory": null, + "op": "DUP1", + "pc": 87, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21085, + "gasCost": 3, + "memory": null, + "op": "PUSH4", + "pc": 88, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21082, + "gasCost": 3, + "memory": null, + "op": "EQ", + "pc": 93, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000023b872dd" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21079, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 94, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21076, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 97, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000001d9" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21066, + "gasCost": 10, + "memory": null, + "op": "DUP1", + "pc": 98, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21063, + "gasCost": 3, + "memory": null, + "op": "PUSH4", + "pc": 99, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21060, + "gasCost": 3, + "memory": null, + "op": "EQ", + "pc": 104, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "000000000000000000000000000000000000000000000000000000002e1a7d4d" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21057, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 105, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21054, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 108, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000001", + "000000000000000000000000000000000000000000000000000000000000025e" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21044, + "gasCost": 10, + "memory": null, + "op": "JUMPDEST", + "pc": 606, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21043, + "gasCost": 1, + "memory": null, + "op": "CALLVALUE", + "pc": 607, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21041, + "gasCost": 2, + "memory": null, + "op": "DUP1", + "pc": 608, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21038, + "gasCost": 3, + "memory": null, + "op": "ISZERO", + "pc": 609, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21035, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 610, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21032, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 613, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001", + "000000000000000000000000000000000000000000000000000000000000026a" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21022, + "gasCost": 10, + "memory": null, + "op": "JUMPDEST", + "pc": 618, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21021, + "gasCost": 1, + "memory": null, + "op": "POP", + "pc": 619, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21019, + "gasCost": 2, + "memory": null, + "op": "PUSH2", + "pc": 620, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21016, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 623, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21013, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 625, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21010, + "gasCost": 3, + "memory": null, + "op": "CALLDATASIZE", + "pc": 626, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21008, + "gasCost": 2, + "memory": null, + "op": "SUB", + "pc": 627, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21005, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 628, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 21002, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 629, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20999, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 630, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20996, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 631, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20993, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 632, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20990, + "gasCost": 3, + "memory": null, + "op": "CALLDATALOAD", + "pc": 633, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20987, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 634, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20984, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 635, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20981, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 637, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20978, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 638, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20975, + "gasCost": 3, + "memory": null, + "op": "SWAP3", + "pc": 639, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20972, + "gasCost": 3, + "memory": null, + "op": "SWAP2", + "pc": 640, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20969, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 641, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20966, + "gasCost": 3, + "memory": null, + "op": "POP", + "pc": 642, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20964, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 643, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000004" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20962, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 644, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000024" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20960, + "gasCost": 2, + "memory": null, + "op": "PUSH2", + "pc": 645, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20957, + "gasCost": 3, + "memory": null, + "op": "JUMP", + "pc": 648, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000a22" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20949, + "gasCost": 8, + "memory": null, + "op": "JUMPDEST", + "pc": 2594, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20948, + "gasCost": 1, + "memory": null, + "op": "DUP1", + "pc": 2595, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20945, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2596, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20942, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2598, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20939, + "gasCost": 3, + "memory": null, + "op": "CALLER", + "pc": 2600, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20937, + "gasCost": 2, + "memory": null, + "op": "PUSH20", + "pc": 2601, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20934, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 2622, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20931, + "gasCost": 3, + "memory": null, + "op": "PUSH20", + "pc": 2623, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20928, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 2644, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20925, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2645, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20922, + "gasCost": 3, + "memory": null, + "op": "MSTORE", + "pc": 2646, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20919, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2647, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20916, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 2649, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20913, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 2650, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20910, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2651, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000003" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20907, + "gasCost": 3, + "memory": null, + "op": "MSTORE", + "pc": 2652, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20904, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2653, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20901, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 2655, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20898, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2656, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20895, + "gasCost": 3, + "memory": null, + "op": "SHA3", + "pc": 2658, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000040", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20853, + "gasCost": 42, + "memory": null, + "op": "SLOAD", + "pc": 2659, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20653, + "gasCost": 200, + "memory": null, + "op": "LT", + "pc": 2660, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20650, + "gasCost": 3, + "memory": null, + "op": "ISZERO", + "pc": 2661, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20647, + "gasCost": 3, + "memory": null, + "op": "ISZERO", + "pc": 2662, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20644, + "gasCost": 3, + "memory": null, + "op": "ISZERO", + "pc": 2663, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20641, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 2664, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20638, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 2667, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000a70" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20628, + "gasCost": 10, + "memory": null, + "op": "JUMPDEST", + "pc": 2672, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20627, + "gasCost": 1, + "memory": null, + "op": "DUP1", + "pc": 2673, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20624, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2674, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20621, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2676, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20618, + "gasCost": 3, + "memory": null, + "op": "CALLER", + "pc": 2678, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20616, + "gasCost": 2, + "memory": null, + "op": "PUSH20", + "pc": 2679, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20613, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 2700, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20610, + "gasCost": 3, + "memory": null, + "op": "PUSH20", + "pc": 2701, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20607, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 2722, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20604, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2723, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20601, + "gasCost": 3, + "memory": null, + "op": "MSTORE", + "pc": 2724, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20598, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2725, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20595, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 2727, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20592, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 2728, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20589, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2729, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000003" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20586, + "gasCost": 3, + "memory": null, + "op": "MSTORE", + "pc": 2730, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20583, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2731, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20580, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 2733, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20577, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2734, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20574, + "gasCost": 3, + "memory": null, + "op": "SHA3", + "pc": 2736, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000040", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20532, + "gasCost": 42, + "memory": null, + "op": "PUSH1", + "pc": 2737, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20529, + "gasCost": 3, + "memory": null, + "op": "DUP3", + "pc": 2739, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20526, + "gasCost": 3, + "memory": null, + "op": "DUP3", + "pc": 2740, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20523, + "gasCost": 3, + "memory": null, + "op": "SLOAD", + "pc": 2741, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20323, + "gasCost": 200, + "memory": null, + "op": "SUB", + "pc": 2742, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20320, + "gasCost": 3, + "memory": null, + "op": "SWAP3", + "pc": 2743, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20317, + "gasCost": 3, + "memory": null, + "op": "POP", + "pc": 2744, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20315, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 2745, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20313, + "gasCost": 2, + "memory": null, + "op": "DUP2", + "pc": 2746, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20310, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 2747, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 20307, + "gasCost": 3, + "memory": null, + "op": "SSTORE", + "pc": 2748, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000000", + "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15307, + "gasCost": 5000, + "memory": null, + "op": "POP", + "pc": 2749, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15305, + "gasCost": 2, + "memory": null, + "op": "CALLER", + "pc": 2750, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15303, + "gasCost": 2, + "memory": null, + "op": "PUSH20", + "pc": 2751, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15300, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 2772, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15297, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 2773, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15294, + "gasCost": 3, + "memory": null, + "op": "DUP3", + "pc": 2776, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "00000000000000000000000000000000000000000000000000000000000008fc" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15291, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 2777, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15288, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2778, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "00000000000000000000000000000000000000000000000000000000000008fc" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15285, + "gasCost": 3, + "memory": null, + "op": "ISZERO", + "pc": 2779, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15282, + "gasCost": 3, + "memory": null, + "op": "MUL", + "pc": 2780, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15277, + "gasCost": 5, + "memory": null, + "op": "SWAP1", + "pc": 2781, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15274, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2782, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15271, + "gasCost": 3, + "memory": null, + "op": "MLOAD", + "pc": 2784, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15268, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2785, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15265, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2787, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15262, + "gasCost": 3, + "memory": null, + "op": "MLOAD", + "pc": 2789, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15259, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 2790, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15256, + "gasCost": 3, + "memory": null, + "op": "DUP4", + "pc": 2791, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15253, + "gasCost": 3, + "memory": null, + "op": "SUB", + "pc": 2792, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15250, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2793, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15247, + "gasCost": 3, + "memory": null, + "op": "DUP6", + "pc": 2794, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15244, + "gasCost": 3, + "memory": null, + "op": "DUP9", + "pc": 2795, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15241, + "gasCost": 3, + "memory": null, + "op": "DUP9", + "pc": 2796, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 15238, + "gasCost": 3, + "memory": null, + "op": "CALL", + "pc": 2797, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7838, + "gasCost": 7400, + "memory": null, + "op": "SWAP4", + "pc": 2798, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7835, + "gasCost": 3, + "memory": null, + "op": "POP", + "pc": 2799, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7833, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 2800, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7831, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 2801, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001", + "00000000000000000000000000000000000000000000000000000000000008fc", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7829, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 2802, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001", + "00000000000000000000000000000000000000000000000000000000000008fc" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7827, + "gasCost": 2, + "memory": null, + "op": "ISZERO", + "pc": 2803, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7824, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 2804, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7821, + "gasCost": 3, + "memory": null, + "op": "ISZERO", + "pc": 2805, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7818, + "gasCost": 3, + "memory": null, + "op": "PUSH2", + "pc": 2806, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7815, + "gasCost": 3, + "memory": null, + "op": "JUMPI", + "pc": 2809, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000b03" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7805, + "gasCost": 10, + "memory": null, + "op": "JUMPDEST", + "pc": 2819, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7804, + "gasCost": 1, + "memory": null, + "op": "POP", + "pc": 2820, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7802, + "gasCost": 2, + "memory": null, + "op": "CALLER", + "pc": 2821, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7800, + "gasCost": 2, + "memory": null, + "op": "PUSH20", + "pc": 2822, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7797, + "gasCost": 3, + "memory": null, + "op": "AND", + "pc": 2843, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7794, + "gasCost": 3, + "memory": null, + "op": "PUSH32", + "pc": 2844, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7791, + "gasCost": 3, + "memory": null, + "op": "DUP3", + "pc": 2877, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7788, + "gasCost": 3, + "memory": null, + "op": "PUSH1", + "pc": 2878, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7785, + "gasCost": 3, + "memory": null, + "op": "MLOAD", + "pc": 2880, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7782, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 2881, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7779, + "gasCost": 3, + "memory": null, + "op": "DUP3", + "pc": 2882, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7776, + "gasCost": 3, + "memory": null, + "op": "DUP2", + "pc": 2883, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7773, + "gasCost": 3, + "memory": null, + "op": "MSTORE", + "pc": 2884, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7764, + "gasCost": 9, + "memory": null, + "op": "PUSH1", + "pc": 2885, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7761, + "gasCost": 3, + "memory": null, + "op": "ADD", + "pc": 2887, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7758, + "gasCost": 3, + "memory": null, + "op": "SWAP2", + "pc": 2888, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000000000000000000000000000000000000000000080", + "00000000000000000000000000000000000000000000000000000000000000a0" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7755, + "gasCost": 3, + "memory": null, + "op": "POP", + "pc": 2889, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "00000000000000000000000000000000000000000000000000000000000000a0", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7753, + "gasCost": 2, + "memory": null, + "op": "POP", + "pc": 2890, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "00000000000000000000000000000000000000000000000000000000000000a0", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7751, + "gasCost": 2, + "memory": null, + "op": "PUSH1", + "pc": 2891, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "00000000000000000000000000000000000000000000000000000000000000a0" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7748, + "gasCost": 3, + "memory": null, + "op": "MLOAD", + "pc": 2893, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "00000000000000000000000000000000000000000000000000000000000000a0", + "0000000000000000000000000000000000000000000000000000000000000040" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7745, + "gasCost": 3, + "memory": null, + "op": "DUP1", + "pc": 2894, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "00000000000000000000000000000000000000000000000000000000000000a0", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7742, + "gasCost": 3, + "memory": null, + "op": "SWAP2", + "pc": 2895, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "00000000000000000000000000000000000000000000000000000000000000a0", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7739, + "gasCost": 3, + "memory": null, + "op": "SUB", + "pc": 2896, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000080", + "00000000000000000000000000000000000000000000000000000000000000a0" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7736, + "gasCost": 3, + "memory": null, + "op": "SWAP1", + "pc": 2897, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000020" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 7733, + "gasCost": 3, + "memory": null, + "op": "LOG2", + "pc": 2898, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", + "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000080" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 6352, + "gasCost": 1381, + "memory": null, + "op": "POP", + "pc": 2899, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289", + "0000000000000000000000000000000000000000000000000de0b6b3a7640000" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 6350, + "gasCost": 2, + "memory": null, + "op": "JUMP", + "pc": 2900, + "stack": [ + "000000000000000000000000000000000000000000000000000000002e1a7d4d", + "0000000000000000000000000000000000000000000000000000000000000289" + ], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 6342, + "gasCost": 8, + "memory": null, + "op": "JUMPDEST", + "pc": 649, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + }, + { + "depth": 0, + "error": "", + "gas": 6341, + "gasCost": 1, + "memory": null, + "op": "STOP", + "pc": 650, + "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], + "storage": null + } +] diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index febb1034e..30508898b 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -7,7 +7,7 @@ import * as _ from 'lodash'; export interface TraceByContractAddress { [contractAddress: string]: StructLog[]; } -function padZeros(address: string) { +function padZeros(address: string): string { return addHexPrefix(_.padStart(stripHexPrefix(address), 40, '0')); } diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts index 58b9203b0..2d6697ce5 100644 --- a/packages/sol-cov/test/trace_test.ts +++ b/packages/sol-cov/test/trace_test.ts @@ -32,7 +32,7 @@ describe('Trace', () => { const trace = [ { op: OpCode.DelegateCall, - stack: ['0x', '0x', delegateCallAddress], + stack: ['0x', '0x', '0x', '0x', delegateCallAddress], depth: 0, }, { diff --git a/packages/subproviders/src/index.ts b/packages/subproviders/src/index.ts index ff28b8a8d..6cc650a4d 100644 --- a/packages/subproviders/src/index.ts +++ b/packages/subproviders/src/index.ts @@ -4,6 +4,7 @@ export { ECSignature } from '@0xproject/types'; import { LedgerEthereumClient } from './types'; +export { prependSubprovider } from './utils/subprovider_utils'; export { EmptyWalletSubprovider } from './subproviders/empty_wallet_subprovider'; export { FakeGasEstimateSubprovider } from './subproviders/fake_gas_estimate_subprovider'; export { InjectedWeb3Subprovider } from './subproviders/injected_web3'; diff --git a/packages/subproviders/src/utils/subprovider_utils.ts b/packages/subproviders/src/utils/subprovider_utils.ts new file mode 100644 index 000000000..380f98606 --- /dev/null +++ b/packages/subproviders/src/utils/subprovider_utils.ts @@ -0,0 +1,13 @@ +import ProviderEngine = require('web3-provider-engine'); + +import { Subprovider } from '../subproviders/subprovider'; + +/** + * Prepends a subprovider to a provider + * @param provider Given provider + * @param subprovider Subprovider to prepend + */ +export function prependSubprovider(provider: ProviderEngine, subprovider: Subprovider): void { + subprovider.setEngine(provider); + (provider as any)._providers = [subprovider, ...(provider as any)._providers]; +} diff --git a/packages/testnet-faucets/bin/server.js b/packages/testnet-faucets/bin/server.js deleted file mode 100644 index bee332843..000000000 --- a/packages/testnet-faucets/bin/server.js +++ /dev/null @@ -1,780 +0,0 @@ -require("source-map-support").install(); -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 6); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -module.exports = require("@0xproject/utils"); - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.configs = { - DISPENSER_ADDRESS: process.env.DISPENSER_ADDRESS.toLowerCase(), - DISPENSER_PRIVATE_KEY: process.env.DISPENSER_PRIVATE_KEY, - ENVIRONMENT: process.env.FAUCET_ENVIRONMENT, - INFURA_API_KEY: process.env.INFURA_API_KEY, - ROLLBAR_ACCESS_KEY: process.env.FAUCET_ROLLBAR_ACCESS_KEY, -}; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -module.exports = require("lodash"); - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [0, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var utils_1 = __webpack_require__(0); -var rollbar = __webpack_require__(10); -var configs_1 = __webpack_require__(1); -exports.errorReporter = { - setup: function () { - var _this = this; - rollbar.init(configs_1.configs.ROLLBAR_ACCESS_KEY, { - environment: configs_1.configs.ENVIRONMENT, - }); - rollbar.handleUncaughtExceptions(configs_1.configs.ROLLBAR_ACCESS_KEY); - process.on('unhandledRejection', function (err) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - utils_1.logUtils.log("Uncaught exception " + err + ". Stack: " + err.stack); - return [4 /*yield*/, this.reportAsync(err)]; - case 1: - _a.sent(); - process.exit(1); - return [2 /*return*/]; - } - }); - }); }); - }, - reportAsync: function (err, req) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (configs_1.configs.ENVIRONMENT === 'development') { - return [2 /*return*/]; // Do not log development environment errors - } - return [2 /*return*/, new Promise(function (resolve, reject) { - rollbar.handleError(err, req, function (rollbarErr) { - if (rollbarErr) { - utils_1.logUtils.log("Error reporting to rollbar, ignoring: " + rollbarErr); - reject(rollbarErr); - } - else { - resolve(); - } - }); - })]; - }); - }); - }, - errorHandler: function () { - return rollbar.errorHandler(configs_1.configs.ROLLBAR_ACCESS_KEY); - }, -}; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = require("0x.js"); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var configs_1 = __webpack_require__(1); -var productionRpcUrls = { - '3': "https://ropsten.infura.io/" + configs_1.configs.INFURA_API_KEY, - '4': "https://rinkeby.infura.io/" + configs_1.configs.INFURA_API_KEY, - '42': "https://kovan.infura.io/" + configs_1.configs.INFURA_API_KEY, -}; -var developmentRpcUrls = { - '50': 'http://127.0.0.1:8545', -}; -exports.rpcUrls = configs_1.configs.ENVIRONMENT === 'development' ? developmentRpcUrls : productionRpcUrls; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(7); - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var bodyParser = __webpack_require__(8); -var express = __webpack_require__(9); -var error_reporter_1 = __webpack_require__(3); -var handler_1 = __webpack_require__(11); -var parameter_transformer_1 = __webpack_require__(18); -// Setup the errorReporter to catch uncaught exceptions and unhandled rejections -error_reporter_1.errorReporter.setup(); -var app = express(); -app.use(bodyParser.json()); // for parsing application/json -app.use(function (req, res, next) { - res.header('Access-Control-Allow-Origin', '*'); - res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); - next(); -}); -var handler = new handler_1.Handler(); -app.get('/ping', function (req, res) { - res.status(200).send('pong'); -}); -app.get('/info', handler.getQueueInfo.bind(handler)); -app.get('/ether/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseEther.bind(handler)); -app.get('/zrx/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseZRX.bind(handler)); -app.get('/order/weth/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseWETHOrder.bind(handler)); -app.get('/order/zrx/:recipient', parameter_transformer_1.parameterTransformer.transform, handler.dispenseZRXOrder.bind(handler)); -// Log to rollbar any errors unhandled by handlers -app.use(error_reporter_1.errorReporter.errorHandler()); -var port = process.env.PORT || 3000; -app.listen(port); - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - -module.exports = require("body-parser"); - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -module.exports = require("express"); - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = require("rollbar"); - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [0, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var _0x_js_1 = __webpack_require__(4); -var utils_1 = __webpack_require__(0); -var _ = __webpack_require__(2); -var Web3 = __webpack_require__(12); -// HACK: web3 injects XMLHttpRequest into the global scope and ProviderEngine checks XMLHttpRequest -// to know whether it is running in a browser or node environment. We need it to be undefined since -// we are not running in a browser env. -// Filed issue: https://github.com/ethereum/web3.js/issues/844 -global.XMLHttpRequest = undefined; -var subproviders_1 = __webpack_require__(13); -var ProviderEngine = __webpack_require__(14); -var RpcSubprovider = __webpack_require__(15); -var configs_1 = __webpack_require__(1); -var dispatch_queue_1 = __webpack_require__(16); -var dispense_asset_tasks_1 = __webpack_require__(17); -var rpc_urls_1 = __webpack_require__(5); -var RequestedAssetType; -(function (RequestedAssetType) { - RequestedAssetType["ETH"] = "ETH"; - RequestedAssetType["WETH"] = "WETH"; - RequestedAssetType["ZRX"] = "ZRX"; -})(RequestedAssetType || (RequestedAssetType = {})); -var FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable -var Handler = /** @class */ (function () { - function Handler() { - var _this = this; - this._networkConfigByNetworkId = {}; - _.forIn(rpc_urls_1.rpcUrls, function (rpcUrl, networkId) { - var providerObj = Handler._createProviderEngine(rpcUrl); - var web3 = new Web3(providerObj); - var zeroExConfig = { - networkId: +networkId, - }; - var zeroEx = new _0x_js_1.ZeroEx(web3.currentProvider, zeroExConfig); - var dispatchQueue = new dispatch_queue_1.DispatchQueue(); - _this._networkConfigByNetworkId[networkId] = { - dispatchQueue: dispatchQueue, - web3: web3, - zeroEx: zeroEx, - }; - }); - } - Handler._createProviderEngine = function (rpcUrl) { - if (_.isUndefined(configs_1.configs.DISPENSER_PRIVATE_KEY)) { - throw new Error('Dispenser Private key not found'); - } - var engine = new ProviderEngine(); - engine.addProvider(new subproviders_1.NonceTrackerSubprovider()); - engine.addProvider(new subproviders_1.PrivateKeyWalletSubprovider(configs_1.configs.DISPENSER_PRIVATE_KEY)); - engine.addProvider(new RpcSubprovider({ - rpcUrl: rpcUrl, - })); - engine.start(); - return engine; - }; - Handler.prototype.getQueueInfo = function (req, res) { - var _this = this; - res.setHeader('Content-Type', 'application/json'); - var queueInfo = _.mapValues(rpc_urls_1.rpcUrls, function (rpcUrl, networkId) { - var dispatchQueue = _this._networkConfigByNetworkId[networkId].dispatchQueue; - return { - full: dispatchQueue.isFull(), - size: dispatchQueue.size(), - }; - }); - var payload = JSON.stringify(queueInfo); - res.status(200).send(payload); - }; - Handler.prototype.dispenseEther = function (req, res) { - this._dispenseAsset(req, res, RequestedAssetType.ETH); - }; - Handler.prototype.dispenseZRX = function (req, res) { - this._dispenseAsset(req, res, RequestedAssetType.ZRX); - }; - Handler.prototype.dispenseWETHOrder = function (req, res) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this._dispenseOrder(req, res, RequestedAssetType.WETH)]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - Handler.prototype.dispenseZRXOrder = function (req, res, next) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this._dispenseOrder(req, res, RequestedAssetType.ZRX)]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - Handler.prototype._dispenseAsset = function (req, res, requestedAssetType) { - var networkId = req.params.networkId; - var recipient = req.params.recipient; - var networkConfig = this._networkConfigByNetworkId[networkId]; - var dispenserTask; - switch (requestedAssetType) { - case RequestedAssetType.ETH: - dispenserTask = dispense_asset_tasks_1.dispenseAssetTasks.dispenseEtherTask(recipient, networkConfig.web3); - break; - case RequestedAssetType.WETH: - case RequestedAssetType.ZRX: - dispenserTask = dispense_asset_tasks_1.dispenseAssetTasks.dispenseTokenTask(recipient, requestedAssetType, networkConfig.zeroEx); - break; - default: - throw new Error("Unsupported asset type: " + requestedAssetType); - } - var didAddToQueue = networkConfig.dispatchQueue.add(dispenserTask); - if (!didAddToQueue) { - res.status(503).send('QUEUE_IS_FULL'); - return; - } - utils_1.logUtils.log("Added " + recipient + " to queue: " + requestedAssetType + " networkId: " + networkId); - res.status(200).end(); - }; - Handler.prototype._dispenseOrder = function (req, res, requestedAssetType) { - return __awaiter(this, void 0, void 0, function () { - var networkConfig, zeroEx, makerToken, takerTokenSymbol, takerToken, makerTokenAmount, takerTokenAmount, order, orderHash, signature, signedOrder, signedOrderHash, payload; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - networkConfig = _.get(this._networkConfigByNetworkId, req.params.networkId); - if (_.isUndefined(networkConfig)) { - res.status(400).send('UNSUPPORTED_NETWORK_ID'); - return [2 /*return*/]; - } - zeroEx = networkConfig.zeroEx; - res.setHeader('Content-Type', 'application/json'); - return [4 /*yield*/, zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType)]; - case 1: - makerToken = _a.sent(); - if (_.isUndefined(makerToken)) { - throw new Error("Unsupported asset type: " + requestedAssetType); - } - takerTokenSymbol = requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH; - return [4 /*yield*/, zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol)]; - case 2: - takerToken = _a.sent(); - if (_.isUndefined(takerToken)) { - throw new Error("Unsupported asset type: " + requestedAssetType); - } - makerTokenAmount = _0x_js_1.ZeroEx.toBaseUnitAmount(new utils_1.BigNumber(0.1), makerToken.decimals); - takerTokenAmount = _0x_js_1.ZeroEx.toBaseUnitAmount(new utils_1.BigNumber(0.1), takerToken.decimals); - order = { - maker: configs_1.configs.DISPENSER_ADDRESS, - taker: req.params.recipient, - makerFee: new utils_1.BigNumber(0), - takerFee: new utils_1.BigNumber(0), - makerTokenAmount: makerTokenAmount, - takerTokenAmount: takerTokenAmount, - makerTokenAddress: makerToken.address, - takerTokenAddress: takerToken.address, - salt: _0x_js_1.ZeroEx.generatePseudoRandomSalt(), - exchangeContractAddress: zeroEx.exchange.getContractAddress(), - feeRecipient: _0x_js_1.ZeroEx.NULL_ADDRESS, - expirationUnixTimestampSec: new utils_1.BigNumber(Date.now() + FIVE_DAYS_IN_MS), - }; - orderHash = _0x_js_1.ZeroEx.getOrderHashHex(order); - return [4 /*yield*/, zeroEx.signOrderHashAsync(orderHash, configs_1.configs.DISPENSER_ADDRESS, false)]; - case 3: - signature = _a.sent(); - signedOrder = __assign({}, order, { ecSignature: signature }); - signedOrderHash = _0x_js_1.ZeroEx.getOrderHashHex(signedOrder); - payload = JSON.stringify(signedOrder); - utils_1.logUtils.log("Dispensed signed order: " + payload); - res.status(200).send(payload); - return [2 /*return*/]; - } - }); - }); - }; - return Handler; -}()); -exports.Handler = Handler; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -module.exports = require("web3"); - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -module.exports = require("@0xproject/subproviders"); - -/***/ }), -/* 14 */ -/***/ (function(module, exports) { - -module.exports = require("web3-provider-engine"); - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -module.exports = require("web3-provider-engine/subproviders/rpc"); - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [0, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var utils_1 = __webpack_require__(0); -var _ = __webpack_require__(2); -var error_reporter_1 = __webpack_require__(3); -var MAX_QUEUE_SIZE = 500; -var DEFAULT_QUEUE_INTERVAL_MS = 1000; -var DispatchQueue = /** @class */ (function () { - function DispatchQueue() { - this._queueIntervalMs = DEFAULT_QUEUE_INTERVAL_MS; - this._queue = []; - this._start(); - } - DispatchQueue.prototype.add = function (taskAsync) { - if (this.isFull()) { - return false; - } - this._queue.push(taskAsync); - return true; - }; - DispatchQueue.prototype.size = function () { - return this._queue.length; - }; - DispatchQueue.prototype.isFull = function () { - return this.size() >= MAX_QUEUE_SIZE; - }; - DispatchQueue.prototype.stop = function () { - if (!_.isUndefined(this._queueIntervalIdIfExists)) { - utils_1.intervalUtils.clearAsyncExcludingInterval(this._queueIntervalIdIfExists); - } - }; - DispatchQueue.prototype._start = function () { - var _this = this; - this._queueIntervalIdIfExists = utils_1.intervalUtils.setAsyncExcludingInterval(function () { return __awaiter(_this, void 0, void 0, function () { - var taskAsync; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - taskAsync = this._queue.shift(); - if (_.isUndefined(taskAsync)) { - return [2 /*return*/, Promise.resolve()]; - } - return [4 /*yield*/, taskAsync()]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); }, this._queueIntervalMs, function (err) { - utils_1.logUtils.log("Unexpected err: " + err + " - " + JSON.stringify(err)); - // tslint:disable-next-line:no-floating-promises - error_reporter_1.errorReporter.reportAsync(err); - }); - }; - return DispatchQueue; -}()); -exports.DispatchQueue = DispatchQueue; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [0, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var _0x_js_1 = __webpack_require__(4); -var utils_1 = __webpack_require__(0); -var _ = __webpack_require__(2); -var configs_1 = __webpack_require__(1); -var DISPENSE_AMOUNT_ETHER = 0.1; -var DISPENSE_AMOUNT_TOKEN = 0.1; -var DISPENSE_MAX_AMOUNT_TOKEN = 2; -var DISPENSE_MAX_AMOUNT_ETHER = 2; -exports.dispenseAssetTasks = { - dispenseEtherTask: function (recipientAddress, web3) { - var _this = this; - return function () { return __awaiter(_this, void 0, void 0, function () { - var userBalance, maxAmountInWei, sendTransactionAsync, txHash; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - utils_1.logUtils.log("Processing ETH " + recipientAddress); - return [4 /*yield*/, utils_1.promisify(web3.eth.getBalance)(recipientAddress)]; - case 1: - userBalance = _a.sent(); - maxAmountInWei = new utils_1.BigNumber(web3.toWei(DISPENSE_MAX_AMOUNT_ETHER, 'ether')); - if (userBalance.greaterThanOrEqualTo(maxAmountInWei)) { - utils_1.logUtils.log("User exceeded ETH balance maximum (" + maxAmountInWei + ") " + recipientAddress + " " + userBalance + " "); - return [2 /*return*/]; - } - sendTransactionAsync = utils_1.promisify(web3.eth.sendTransaction); - return [4 /*yield*/, sendTransactionAsync({ - from: configs_1.configs.DISPENSER_ADDRESS, - to: recipientAddress, - value: web3.toWei(DISPENSE_AMOUNT_ETHER, 'ether'), - })]; - case 2: - txHash = _a.sent(); - utils_1.logUtils.log("Sent " + DISPENSE_AMOUNT_ETHER + " ETH to " + recipientAddress + " tx: " + txHash); - return [2 /*return*/]; - } - }); - }); }; - }, - dispenseTokenTask: function (recipientAddress, tokenSymbol, zeroEx) { - var _this = this; - return function () { return __awaiter(_this, void 0, void 0, function () { - var amountToDispense, token, baseUnitAmount, userBalanceBaseUnits, maxAmountBaseUnits, txHash; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - utils_1.logUtils.log("Processing " + tokenSymbol + " " + recipientAddress); - amountToDispense = new utils_1.BigNumber(DISPENSE_AMOUNT_TOKEN); - return [4 /*yield*/, zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(tokenSymbol)]; - case 1: - token = _a.sent(); - if (_.isUndefined(token)) { - throw new Error("Unsupported asset type: " + tokenSymbol); - } - baseUnitAmount = _0x_js_1.ZeroEx.toBaseUnitAmount(amountToDispense, token.decimals); - return [4 /*yield*/, zeroEx.token.getBalanceAsync(token.address, recipientAddress)]; - case 2: - userBalanceBaseUnits = _a.sent(); - maxAmountBaseUnits = _0x_js_1.ZeroEx.toBaseUnitAmount(new utils_1.BigNumber(DISPENSE_MAX_AMOUNT_TOKEN), token.decimals); - if (userBalanceBaseUnits.greaterThanOrEqualTo(maxAmountBaseUnits)) { - utils_1.logUtils.log("User exceeded token balance maximum (" + maxAmountBaseUnits + ") " + recipientAddress + " " + userBalanceBaseUnits + " "); - return [2 /*return*/]; - } - return [4 /*yield*/, zeroEx.token.transferAsync(token.address, configs_1.configs.DISPENSER_ADDRESS, recipientAddress, baseUnitAmount)]; - case 3: - txHash = _a.sent(); - utils_1.logUtils.log("Sent " + amountToDispense + " ZRX to " + recipientAddress + " tx: " + txHash); - return [2 /*return*/]; - } - }); - }); }; - }, -}; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var utils_1 = __webpack_require__(0); -var _ = __webpack_require__(2); -var rpc_urls_1 = __webpack_require__(5); -var DEFAULT_NETWORK_ID = 42; // kovan -exports.parameterTransformer = { - transform: function (req, res, next) { - var recipientAddress = req.params.recipient; - if (_.isUndefined(recipientAddress) || !utils_1.addressUtils.isAddress(recipientAddress)) { - res.status(400).send('INVALID_RECIPIENT_ADDRESS'); - return; - } - var lowerCaseRecipientAddress = recipientAddress.toLowerCase(); - req.params.recipient = lowerCaseRecipientAddress; - var networkId = _.get(req.query, 'networkId', DEFAULT_NETWORK_ID); - var rpcUrlIfExists = _.get(rpc_urls_1.rpcUrls, networkId); - if (_.isUndefined(rpcUrlIfExists)) { - res.status(400).send('UNSUPPORTED_NETWORK_ID'); - return; - } - req.params.networkId = networkId; - next(); - }, -}; - - -/***/ }) -/******/ ]); -//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/packages/testnet-faucets/bin/server.js.map b/packages/testnet-faucets/bin/server.js.map deleted file mode 100644 index c8c227727..000000000 --- a/packages/testnet-faucets/bin/server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap b91d2cee364b5e101d43","webpack:///external \"@0xproject/utils\"","webpack:///./src/ts/configs.ts","webpack:///external \"lodash\"","webpack:///./src/ts/error_reporter.ts","webpack:///external \"0x.js\"","webpack:///./src/ts/rpc_urls.ts","webpack:///./src/ts/server.ts","webpack:///external \"body-parser\"","webpack:///external \"express\"","webpack:///external \"rollbar\"","webpack:///./src/ts/handler.ts","webpack:///external \"web3\"","webpack:///external \"@0xproject/subproviders\"","webpack:///external \"web3-provider-engine\"","webpack:///external \"web3-provider-engine/subproviders/rpc\"","webpack:///./src/ts/dispatch_queue.ts","webpack:///./src/ts/dispense_asset_tasks.ts","webpack:///./src/ts/parameter_transformer.ts"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA,6C;;;;;;;;;ACAa,eAAO,GAAG;IACnB,iBAAiB,EAAG,OAAO,CAAC,GAAG,CAAC,iBAA4B,CAAC,WAAW,EAAE;IAC1E,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;IACxD,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;IAC3C,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;IAC1C,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;CAC5D,CAAC;;;;;;;ACNF,mC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,qCAA4C;AAE5C,sCAAoC;AAEpC,uCAAoC;AAEvB,qBAAa,GAAG;IACzB,KAAK;QAAL,iBAUC;QATG,OAAO,CAAC,IAAI,CAAC,iBAAO,CAAC,kBAAkB,EAAE;YACrC,WAAW,EAAE,iBAAO,CAAC,WAAW;SACnC,CAAC,CAAC;QACH,OAAO,CAAC,wBAAwB,CAAC,iBAAO,CAAC,kBAAkB,CAAC,CAAC;QAC7D,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAO,GAAU;;;;wBAC9C,gBAAQ,CAAC,GAAG,CAAC,wBAAsB,GAAG,iBAAY,GAAG,CAAC,KAAO,CAAC,CAAC;wBAC/D,qBAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;;wBAA3B,SAA2B,CAAC;wBAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;aACnB,CAAC,CAAC;IACP,CAAC;IACK,WAAW,EAAjB,UAAkB,GAAU,EAAE,GAAqB;;;gBAC/C,EAAE,CAAC,CAAC,iBAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC;oBACxC,MAAM,gBAAC,CAAC,4CAA4C;gBACxD,CAAC;gBACD,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBAC/B,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,UAAC,UAAiB;4BAC5C,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;gCACb,gBAAQ,CAAC,GAAG,CAAC,2CAAyC,UAAY,CAAC,CAAC;gCACpE,MAAM,CAAC,UAAU,CAAC,CAAC;4BACvB,CAAC;4BAAC,IAAI,CAAC,CAAC;gCACJ,OAAO,EAAE,CAAC;4BACd,CAAC;wBACL,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,EAAC;;;KACN;IACD,YAAY;QACR,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5D,CAAC;CACJ,CAAC;;;;;;;ACpCF,kC;;;;;;;;;ACAA,uCAAoC;AAEpC,IAAM,iBAAiB,GAAG;IACtB,GAAG,EAAE,+BAA6B,iBAAO,CAAC,cAAgB;IAC1D,GAAG,EAAE,+BAA6B,iBAAO,CAAC,cAAgB;IAC1D,IAAI,EAAE,6BAA2B,iBAAO,CAAC,cAAgB;CAC5D,CAAC;AAEF,IAAM,kBAAkB,GAAG;IACvB,IAAI,EAAE,uBAAuB;CAChC,CAAC;AAEW,eAAO,GAAG,iBAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,CAAC;;;;;;;;;;;;;;;;;ACZtG,wCAA0C;AAC1C,qCAAmC;AAEnC,8CAAiD;AACjD,wCAAoC;AACpC,sDAA+D;AAE/D,gFAAgF;AAChF,8BAAa,CAAC,KAAK,EAAE,CAAC;AAEtB,IAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,+BAA+B;AAC3D,GAAG,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,GAAG,EAAE,IAAI;IACnB,GAAG,CAAC,MAAM,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,gDAAgD,CAAC,CAAC;IAC7F,IAAI,EAAE,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,IAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;AAC9B,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,UAAC,GAAoB,EAAE,GAAqB;IACzD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AACH,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AACrD,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAClG,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9F,GAAG,CAAC,GAAG,CAAC,wBAAwB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3G,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,4CAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzG,kDAAkD;AAClD,GAAG,CAAC,GAAG,CAAC,8BAAa,CAAC,YAAY,EAAE,CAAC,CAAC;AACtC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;AACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;;;;;;AC/BjB,wC;;;;;;ACAA,oC;;;;;;ACAA,oC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,sCAAmD;AACnD,qCAAuD;AAEvD,+BAA4B;AAC5B,mCAA6B;AAE7B,mGAAmG;AACnG,mGAAmG;AACnG,uCAAuC;AACvC,8DAA8D;AAC7D,MAAc,CAAC,cAAc,GAAG,SAAS,CAAC;AAC3C,6CAA+F;AAC/F,6CAAwD;AACxD,6CAAyE;AAEzE,uCAAoC;AACpC,+CAAiD;AACjD,qDAA4D;AAC5D,wCAAqC;AAYrC,IAAK,kBAIJ;AAJD,WAAK,kBAAkB;IACnB,iCAAW;IACX,mCAAa;IACb,iCAAW;AACf,CAAC,EAJI,kBAAkB,KAAlB,kBAAkB,QAItB;AAED,IAAM,eAAe,GAAG,MAAM,CAAC,CAAC,+BAA+B;AAE/D;IAiBI;QAAA,iBAeC;QA/BO,8BAAyB,GAAmC,EAAE,CAAC;QAiBnE,CAAC,CAAC,KAAK,CAAC,kBAAO,EAAE,UAAC,MAAc,EAAE,SAAiB;YAC/C,IAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAC1D,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;YACnC,IAAM,YAAY,GAAG;gBACjB,SAAS,EAAE,CAAC,SAAS;aACxB,CAAC;YACF,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;YAC9D,IAAM,aAAa,GAAG,IAAI,8BAAa,EAAE,CAAC;YAC1C,KAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,GAAG;gBACxC,aAAa;gBACb,IAAI;gBACJ,MAAM;aACT,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IA9Bc,6BAAqB,GAApC,UAAqC,MAAc;QAC/C,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,iBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,IAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,IAAI,sCAAuB,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,WAAW,CAAC,IAAI,0CAA2B,CAAC,iBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACnF,MAAM,CAAC,WAAW,CACd,IAAI,cAAc,CAAC;YACf,MAAM;SACT,CAAC,CACL,CAAC;QACF,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,MAAM,CAAC;IAClB,CAAC;IAiBM,8BAAY,GAAnB,UAAoB,GAAoB,EAAE,GAAqB;QAA/D,iBAWC;QAVG,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAClD,IAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,kBAAO,EAAE,UAAC,MAAc,EAAE,SAAiB;YACrE,IAAM,aAAa,GAAG,KAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC;YAC9E,MAAM,CAAC;gBACH,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE;gBAC5B,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE;aAC7B,CAAC;QACN,CAAC,CAAC,CAAC;QACH,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC1C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IACM,+BAAa,GAApB,UAAqB,GAAoB,EAAE,GAAqB;QAC5D,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IACM,6BAAW,GAAlB,UAAmB,GAAoB,EAAE,GAAqB;QAC1D,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IACY,mCAAiB,GAA9B,UAA+B,GAAoB,EAAE,GAAqB;;;;4BACtE,qBAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC;;wBAA5D,SAA4D,CAAC;;;;;KAChE;IACY,kCAAgB,GAA7B,UAA8B,GAAoB,EAAE,GAAqB,EAAE,IAA0B;;;;4BACjG,qBAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,GAAG,CAAC;;wBAA3D,SAA2D,CAAC;;;;;KAC/D;IACO,gCAAc,GAAtB,UAAuB,GAAoB,EAAE,GAAqB,EAAE,kBAAsC;QACtG,IAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;QACvC,IAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;QACvC,IAAM,aAAa,GAAG,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,aAAa,CAAC;QAClB,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;YACzB,KAAK,kBAAkB,CAAC,GAAG;gBACvB,aAAa,GAAG,yCAAkB,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;gBACpF,KAAK,CAAC;YACV,KAAK,kBAAkB,CAAC,IAAI,CAAC;YAC7B,KAAK,kBAAkB,CAAC,GAAG;gBACvB,aAAa,GAAG,yCAAkB,CAAC,iBAAiB,CAChD,SAAS,EACT,kBAAkB,EAClB,aAAa,CAAC,MAAM,CACvB,CAAC;gBACF,KAAK,CAAC;YACV;gBACI,MAAM,IAAI,KAAK,CAAC,6BAA2B,kBAAoB,CAAC,CAAC;QACzE,CAAC;QACD,IAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;YACjB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtC,MAAM,CAAC;QACX,CAAC;QACD,gBAAQ,CAAC,GAAG,CAAC,WAAS,SAAS,mBAAc,kBAAkB,oBAAe,SAAW,CAAC,CAAC;QAC3F,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1B,CAAC;IACa,gCAAc,GAA5B,UAA6B,GAAoB,EAAE,GAAqB,EAAE,kBAAsC;;;;;;wBACtG,aAAa,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;wBAClF,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;4BAC/B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;4BAC/C,MAAM,gBAAC;wBACX,CAAC;wBACK,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;wBACpC,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;wBAC/B,qBAAM,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC,kBAAkB,CAAC;;wBAAzF,UAAU,GAAG,SAA4E;wBAC/F,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;4BAC5B,MAAM,IAAI,KAAK,CAAC,6BAA2B,kBAAoB,CAAC,CAAC;wBACrE,CAAC;wBACK,gBAAgB,GAClB,kBAAkB,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC;wBACnF,qBAAM,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC,gBAAgB,CAAC;;wBAAvF,UAAU,GAAG,SAA0E;wBAC7F,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;4BAC5B,MAAM,IAAI,KAAK,CAAC,6BAA2B,kBAAoB,CAAC,CAAC;wBACrE,CAAC;wBACK,gBAAgB,GAAG,eAAM,CAAC,gBAAgB,CAAC,IAAI,iBAAS,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;wBACpF,gBAAgB,GAAG,eAAM,CAAC,gBAAgB,CAAC,IAAI,iBAAS,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;wBACpF,KAAK,GAAU;4BACjB,KAAK,EAAE,iBAAO,CAAC,iBAAiB;4BAChC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS;4BAC3B,QAAQ,EAAE,IAAI,iBAAS,CAAC,CAAC,CAAC;4BAC1B,QAAQ,EAAE,IAAI,iBAAS,CAAC,CAAC,CAAC;4BAC1B,gBAAgB;4BAChB,gBAAgB;4BAChB,iBAAiB,EAAE,UAAU,CAAC,OAAO;4BACrC,iBAAiB,EAAE,UAAU,CAAC,OAAO;4BACrC,IAAI,EAAE,eAAM,CAAC,wBAAwB,EAAE;4BACvC,uBAAuB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE;4BAC7D,YAAY,EAAE,eAAM,CAAC,YAAY;4BACjC,0BAA0B,EAAE,IAAI,iBAAS,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC;yBAC1E,CAAC;wBACI,SAAS,GAAG,eAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;wBAC9B,qBAAM,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,iBAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC;;wBAAxF,SAAS,GAAG,SAA4E;wBACxF,WAAW,gBACV,KAAK,IACR,WAAW,EAAE,SAAS,GACzB,CAAC;wBACI,eAAe,GAAG,eAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;wBACtD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;wBAC5C,gBAAQ,CAAC,GAAG,CAAC,6BAA2B,OAAS,CAAC,CAAC;wBACnD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;;;;KACjC;IACL,cAAC;AAAD,CAAC;AAlIY,0BAAO;;;;;;;ACtCpB,iC;;;;;;ACAA,oD;;;;;;ACAA,iD;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,qCAA2D;AAC3D,+BAA4B;AAE5B,8CAAiD;AAEjD,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC;IAII;QACI,IAAI,CAAC,gBAAgB,GAAG,yBAAyB,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IACM,2BAAG,GAAV,UAAW,SAA8B;QACrC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;IACM,4BAAI,GAAX;QACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IACM,8BAAM,GAAb;QACI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,cAAc,CAAC;IACzC,CAAC;IACM,4BAAI,GAAX;QACI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;YAChD,qBAAa,CAAC,2BAA2B,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;IACO,8BAAM,GAAd;QAAA,iBAgBC;QAfG,IAAI,CAAC,wBAAwB,GAAG,qBAAa,CAAC,yBAAyB,CACnE;;;;;wBACU,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;wBACtC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;4BAC3B,MAAM,gBAAC,OAAO,CAAC,OAAO,EAAE,EAAC;wBAC7B,CAAC;wBACD,qBAAM,SAAS,EAAE;;wBAAjB,SAAiB,CAAC;;;;aACrB,EACD,IAAI,CAAC,gBAAgB,EACrB,UAAC,GAAU;YACP,gBAAQ,CAAC,GAAG,CAAC,qBAAmB,GAAG,WAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAG,CAAC,CAAC;YAChE,gDAAgD;YAChD,8BAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CACJ,CAAC;IACN,CAAC;IACL,oBAAC;AAAD,CAAC;AA5CY,sCAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACR1B,sCAA+B;AAC/B,qCAAkE;AAClE,+BAA4B;AAG5B,uCAAoC;AAGpC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,IAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,IAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,IAAM,yBAAyB,GAAG,CAAC,CAAC;AAEvB,0BAAkB,GAAG;IAC9B,iBAAiB,YAAC,gBAAwB,EAAE,IAAU;QAAtD,iBAmBC;QAlBG,MAAM,CAAC;;;;;wBACH,gBAAQ,CAAC,GAAG,CAAC,oBAAkB,gBAAkB,CAAC,CAAC;wBAC/B,qBAAM,iBAAS,CAAY,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,gBAAgB,CAAC;;wBAA/E,WAAW,GAAG,SAAiE;wBAC/E,cAAc,GAAG,IAAI,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC,CAAC;wBACrF,EAAE,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;4BACnD,gBAAQ,CAAC,GAAG,CACR,wCAAsC,cAAc,UAAK,gBAAgB,SAAI,WAAW,MAAG,CAC9F,CAAC;4BACF,MAAM,gBAAC;wBACX,CAAC;wBACK,oBAAoB,GAAG,iBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;wBAClD,qBAAM,oBAAoB,CAAC;gCACtC,IAAI,EAAE,iBAAO,CAAC,iBAAiB;gCAC/B,EAAE,EAAE,gBAAgB;gCACpB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,OAAO,CAAC;6BACpD,CAAC;;wBAJI,MAAM,GAAG,SAIb;wBACF,gBAAQ,CAAC,GAAG,CAAC,UAAQ,qBAAqB,gBAAW,gBAAgB,aAAQ,MAAQ,CAAC,CAAC;;;;aAC1F,CAAC;IACN,CAAC;IACD,iBAAiB,YAAC,gBAAwB,EAAE,WAAmB,EAAE,MAAc;QAA/E,iBA4BC;QA3BG,MAAM,CAAC;;;;;wBACH,gBAAQ,CAAC,GAAG,CAAC,gBAAc,WAAW,SAAI,gBAAkB,CAAC,CAAC;wBACxD,gBAAgB,GAAG,IAAI,iBAAS,CAAC,qBAAqB,CAAC,CAAC;wBAChD,qBAAM,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC,WAAW,CAAC;;wBAA7E,KAAK,GAAG,SAAqE;wBACnF,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;4BACvB,MAAM,IAAI,KAAK,CAAC,6BAA2B,WAAa,CAAC,CAAC;wBAC9D,CAAC;wBACK,cAAc,GAAG,eAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;wBACpD,qBAAM,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC;;wBAA1F,oBAAoB,GAAG,SAAmE;wBAC1F,kBAAkB,GAAG,eAAM,CAAC,gBAAgB,CAC9C,IAAI,iBAAS,CAAC,yBAAyB,CAAC,EACxC,KAAK,CAAC,QAAQ,CACjB,CAAC;wBACF,EAAE,CAAC,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;4BAChE,gBAAQ,CAAC,GAAG,CACR,0CAAwC,kBAAkB,UAAK,gBAAgB,SAAI,oBAAoB,MAAG,CAC7G,CAAC;4BACF,MAAM,gBAAC;wBACX,CAAC;wBACc,qBAAM,MAAM,CAAC,KAAK,CAAC,aAAa,CAC3C,KAAK,CAAC,OAAO,EACb,iBAAO,CAAC,iBAAiB,EACzB,gBAAgB,EAChB,cAAc,CACjB;;wBALK,MAAM,GAAG,SAKd;wBACD,gBAAQ,CAAC,GAAG,CAAC,UAAQ,gBAAgB,gBAAW,gBAAgB,aAAQ,MAAQ,CAAC,CAAC;;;;aACrF,CAAC;IACN,CAAC;CACJ,CAAC;;;;;;;;;;AC/DF,qCAAgD;AAEhD,+BAA4B;AAG5B,wCAAqC;AAErC,IAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,QAAQ;AAE1B,4BAAoB,GAAG;IAChC,SAAS,YAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;QACrD,IAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;QAC9C,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAY,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;YAC/E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;YAClD,MAAM,CAAC;QACX,CAAC;QACD,IAAM,yBAAyB,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;QACjE,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,yBAAyB,CAAC;QACjD,IAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACpE,IAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAO,EAAE,SAAS,CAAC,CAAC;QACjD,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YAChC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAC/C,MAAM,CAAC;QACX,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,IAAI,EAAE,CAAC;IACX,CAAC;CACJ,CAAC","file":"server.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b91d2cee364b5e101d43","module.exports = require(\"@0xproject/utils\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"@0xproject/utils\"\n// module id = 0\n// module chunks = 0","export const configs = {\n DISPENSER_ADDRESS: (process.env.DISPENSER_ADDRESS as string).toLowerCase(),\n DISPENSER_PRIVATE_KEY: process.env.DISPENSER_PRIVATE_KEY,\n ENVIRONMENT: process.env.FAUCET_ENVIRONMENT,\n INFURA_API_KEY: process.env.INFURA_API_KEY,\n ROLLBAR_ACCESS_KEY: process.env.FAUCET_ROLLBAR_ACCESS_KEY,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/configs.ts","module.exports = require(\"lodash\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"lodash\"\n// module id = 2\n// module chunks = 0","import { logUtils } from '@0xproject/utils';\nimport * as express from 'express';\nimport rollbar = require('rollbar');\n\nimport { configs } from './configs';\n\nexport const errorReporter = {\n setup() {\n rollbar.init(configs.ROLLBAR_ACCESS_KEY, {\n environment: configs.ENVIRONMENT,\n });\n rollbar.handleUncaughtExceptions(configs.ROLLBAR_ACCESS_KEY);\n process.on('unhandledRejection', async (err: Error) => {\n logUtils.log(`Uncaught exception ${err}. Stack: ${err.stack}`);\n await this.reportAsync(err);\n process.exit(1);\n });\n },\n async reportAsync(err: Error, req?: express.Request): Promise {\n if (configs.ENVIRONMENT === 'development') {\n return; // Do not log development environment errors\n }\n return new Promise((resolve, reject) => {\n rollbar.handleError(err, req, (rollbarErr: Error) => {\n if (rollbarErr) {\n logUtils.log(`Error reporting to rollbar, ignoring: ${rollbarErr}`);\n reject(rollbarErr);\n } else {\n resolve();\n }\n });\n });\n },\n errorHandler() {\n return rollbar.errorHandler(configs.ROLLBAR_ACCESS_KEY);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/error_reporter.ts","module.exports = require(\"0x.js\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"0x.js\"\n// module id = 4\n// module chunks = 0","import { configs } from './configs';\n\nconst productionRpcUrls = {\n '3': `https://ropsten.infura.io/${configs.INFURA_API_KEY}`,\n '4': `https://rinkeby.infura.io/${configs.INFURA_API_KEY}`,\n '42': `https://kovan.infura.io/${configs.INFURA_API_KEY}`,\n};\n\nconst developmentRpcUrls = {\n '50': 'http://127.0.0.1:8545',\n};\n\nexport const rpcUrls = configs.ENVIRONMENT === 'development' ? developmentRpcUrls : productionRpcUrls;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/rpc_urls.ts","import * as bodyParser from 'body-parser';\nimport * as express from 'express';\n\nimport { errorReporter } from './error_reporter';\nimport { Handler } from './handler';\nimport { parameterTransformer } from './parameter_transformer';\n\n// Setup the errorReporter to catch uncaught exceptions and unhandled rejections\nerrorReporter.setup();\n\nconst app = express();\napp.use(bodyParser.json()); // for parsing application/json\napp.use((req, res, next) => {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');\n next();\n});\n\nconst handler = new Handler();\napp.get('/ping', (req: express.Request, res: express.Response) => {\n res.status(200).send('pong');\n});\napp.get('/info', handler.getQueueInfo.bind(handler));\napp.get('/ether/:recipient', parameterTransformer.transform, handler.dispenseEther.bind(handler));\napp.get('/zrx/:recipient', parameterTransformer.transform, handler.dispenseZRX.bind(handler));\napp.get('/order/weth/:recipient', parameterTransformer.transform, handler.dispenseWETHOrder.bind(handler));\napp.get('/order/zrx/:recipient', parameterTransformer.transform, handler.dispenseZRXOrder.bind(handler));\n\n// Log to rollbar any errors unhandled by handlers\napp.use(errorReporter.errorHandler());\nconst port = process.env.PORT || 3000;\napp.listen(port);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/server.ts","module.exports = require(\"body-parser\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"body-parser\"\n// module id = 8\n// module chunks = 0","module.exports = require(\"express\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"express\"\n// module id = 9\n// module chunks = 0","module.exports = require(\"rollbar\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"rollbar\"\n// module id = 10\n// module chunks = 0","import { Order, SignedOrder, ZeroEx } from '0x.js';\nimport { BigNumber, logUtils } from '@0xproject/utils';\nimport * as express from 'express';\nimport * as _ from 'lodash';\nimport * as Web3 from 'web3';\n\n// HACK: web3 injects XMLHttpRequest into the global scope and ProviderEngine checks XMLHttpRequest\n// to know whether it is running in a browser or node environment. We need it to be undefined since\n// we are not running in a browser env.\n// Filed issue: https://github.com/ethereum/web3.js/issues/844\n(global as any).XMLHttpRequest = undefined;\nimport { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders';\nimport ProviderEngine = require('web3-provider-engine');\nimport RpcSubprovider = require('web3-provider-engine/subproviders/rpc');\n\nimport { configs } from './configs';\nimport { DispatchQueue } from './dispatch_queue';\nimport { dispenseAssetTasks } from './dispense_asset_tasks';\nimport { rpcUrls } from './rpc_urls';\n\ninterface NetworkConfig {\n dispatchQueue: DispatchQueue;\n web3: Web3;\n zeroEx: ZeroEx;\n}\n\ninterface ItemByNetworkId {\n [networkId: string]: T;\n}\n\nenum RequestedAssetType {\n ETH = 'ETH',\n WETH = 'WETH',\n ZRX = 'ZRX',\n}\n\nconst FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable\n\nexport class Handler {\n private _networkConfigByNetworkId: ItemByNetworkId = {};\n private static _createProviderEngine(rpcUrl: string) {\n if (_.isUndefined(configs.DISPENSER_PRIVATE_KEY)) {\n throw new Error('Dispenser Private key not found');\n }\n const engine = new ProviderEngine();\n engine.addProvider(new NonceTrackerSubprovider());\n engine.addProvider(new PrivateKeyWalletSubprovider(configs.DISPENSER_PRIVATE_KEY));\n engine.addProvider(\n new RpcSubprovider({\n rpcUrl,\n }),\n );\n engine.start();\n return engine;\n }\n constructor() {\n _.forIn(rpcUrls, (rpcUrl: string, networkId: string) => {\n const providerObj = Handler._createProviderEngine(rpcUrl);\n const web3 = new Web3(providerObj);\n const zeroExConfig = {\n networkId: +networkId,\n };\n const zeroEx = new ZeroEx(web3.currentProvider, zeroExConfig);\n const dispatchQueue = new DispatchQueue();\n this._networkConfigByNetworkId[networkId] = {\n dispatchQueue,\n web3,\n zeroEx,\n };\n });\n }\n public getQueueInfo(req: express.Request, res: express.Response) {\n res.setHeader('Content-Type', 'application/json');\n const queueInfo = _.mapValues(rpcUrls, (rpcUrl: string, networkId: string) => {\n const dispatchQueue = this._networkConfigByNetworkId[networkId].dispatchQueue;\n return {\n full: dispatchQueue.isFull(),\n size: dispatchQueue.size(),\n };\n });\n const payload = JSON.stringify(queueInfo);\n res.status(200).send(payload);\n }\n public dispenseEther(req: express.Request, res: express.Response) {\n this._dispenseAsset(req, res, RequestedAssetType.ETH);\n }\n public dispenseZRX(req: express.Request, res: express.Response) {\n this._dispenseAsset(req, res, RequestedAssetType.ZRX);\n }\n public async dispenseWETHOrder(req: express.Request, res: express.Response) {\n await this._dispenseOrder(req, res, RequestedAssetType.WETH);\n }\n public async dispenseZRXOrder(req: express.Request, res: express.Response, next: express.NextFunction) {\n await this._dispenseOrder(req, res, RequestedAssetType.ZRX);\n }\n private _dispenseAsset(req: express.Request, res: express.Response, requestedAssetType: RequestedAssetType) {\n const networkId = req.params.networkId;\n const recipient = req.params.recipient;\n const networkConfig = this._networkConfigByNetworkId[networkId];\n let dispenserTask;\n switch (requestedAssetType) {\n case RequestedAssetType.ETH:\n dispenserTask = dispenseAssetTasks.dispenseEtherTask(recipient, networkConfig.web3);\n break;\n case RequestedAssetType.WETH:\n case RequestedAssetType.ZRX:\n dispenserTask = dispenseAssetTasks.dispenseTokenTask(\n recipient,\n requestedAssetType,\n networkConfig.zeroEx,\n );\n break;\n default:\n throw new Error(`Unsupported asset type: ${requestedAssetType}`);\n }\n const didAddToQueue = networkConfig.dispatchQueue.add(dispenserTask);\n if (!didAddToQueue) {\n res.status(503).send('QUEUE_IS_FULL');\n return;\n }\n logUtils.log(`Added ${recipient} to queue: ${requestedAssetType} networkId: ${networkId}`);\n res.status(200).end();\n }\n private async _dispenseOrder(req: express.Request, res: express.Response, requestedAssetType: RequestedAssetType) {\n const networkConfig = _.get(this._networkConfigByNetworkId, req.params.networkId);\n if (_.isUndefined(networkConfig)) {\n res.status(400).send('UNSUPPORTED_NETWORK_ID');\n return;\n }\n const zeroEx = networkConfig.zeroEx;\n res.setHeader('Content-Type', 'application/json');\n const makerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType);\n if (_.isUndefined(makerToken)) {\n throw new Error(`Unsupported asset type: ${requestedAssetType}`);\n }\n const takerTokenSymbol =\n requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH;\n const takerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol);\n if (_.isUndefined(takerToken)) {\n throw new Error(`Unsupported asset type: ${requestedAssetType}`);\n }\n const makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), makerToken.decimals);\n const takerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), takerToken.decimals);\n const order: Order = {\n maker: configs.DISPENSER_ADDRESS,\n taker: req.params.recipient,\n makerFee: new BigNumber(0),\n takerFee: new BigNumber(0),\n makerTokenAmount,\n takerTokenAmount,\n makerTokenAddress: makerToken.address,\n takerTokenAddress: takerToken.address,\n salt: ZeroEx.generatePseudoRandomSalt(),\n exchangeContractAddress: zeroEx.exchange.getContractAddress(),\n feeRecipient: ZeroEx.NULL_ADDRESS,\n expirationUnixTimestampSec: new BigNumber(Date.now() + FIVE_DAYS_IN_MS),\n };\n const orderHash = ZeroEx.getOrderHashHex(order);\n const signature = await zeroEx.signOrderHashAsync(orderHash, configs.DISPENSER_ADDRESS, false);\n const signedOrder = {\n ...order,\n ecSignature: signature,\n };\n const signedOrderHash = ZeroEx.getOrderHashHex(signedOrder);\n const payload = JSON.stringify(signedOrder);\n logUtils.log(`Dispensed signed order: ${payload}`);\n res.status(200).send(payload);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/handler.ts","module.exports = require(\"web3\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"web3\"\n// module id = 12\n// module chunks = 0","module.exports = require(\"@0xproject/subproviders\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"@0xproject/subproviders\"\n// module id = 13\n// module chunks = 0","module.exports = require(\"web3-provider-engine\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"web3-provider-engine\"\n// module id = 14\n// module chunks = 0","module.exports = require(\"web3-provider-engine/subproviders/rpc\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"web3-provider-engine/subproviders/rpc\"\n// module id = 15\n// module chunks = 0","import { intervalUtils, logUtils } from '@0xproject/utils';\nimport * as _ from 'lodash';\n\nimport { errorReporter } from './error_reporter';\n\nconst MAX_QUEUE_SIZE = 500;\nconst DEFAULT_QUEUE_INTERVAL_MS = 1000;\n\nexport class DispatchQueue {\n private _queueIntervalMs: number;\n private _queue: Array<() => Promise>;\n private _queueIntervalIdIfExists?: NodeJS.Timer;\n constructor() {\n this._queueIntervalMs = DEFAULT_QUEUE_INTERVAL_MS;\n this._queue = [];\n this._start();\n }\n public add(taskAsync: () => Promise): boolean {\n if (this.isFull()) {\n return false;\n }\n this._queue.push(taskAsync);\n return true;\n }\n public size(): number {\n return this._queue.length;\n }\n public isFull(): boolean {\n return this.size() >= MAX_QUEUE_SIZE;\n }\n public stop() {\n if (!_.isUndefined(this._queueIntervalIdIfExists)) {\n intervalUtils.clearAsyncExcludingInterval(this._queueIntervalIdIfExists);\n }\n }\n private _start() {\n this._queueIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval(\n async () => {\n const taskAsync = this._queue.shift();\n if (_.isUndefined(taskAsync)) {\n return Promise.resolve();\n }\n await taskAsync();\n },\n this._queueIntervalMs,\n (err: Error) => {\n logUtils.log(`Unexpected err: ${err} - ${JSON.stringify(err)}`);\n // tslint:disable-next-line:no-floating-promises\n errorReporter.reportAsync(err);\n },\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/dispatch_queue.ts","import { ZeroEx } from '0x.js';\nimport { BigNumber, logUtils, promisify } from '@0xproject/utils';\nimport * as _ from 'lodash';\nimport * as Web3 from 'web3';\n\nimport { configs } from './configs';\nimport { errorReporter } from './error_reporter';\n\nconst DISPENSE_AMOUNT_ETHER = 0.1;\nconst DISPENSE_AMOUNT_TOKEN = 0.1;\nconst DISPENSE_MAX_AMOUNT_TOKEN = 2;\nconst DISPENSE_MAX_AMOUNT_ETHER = 2;\n\nexport const dispenseAssetTasks = {\n dispenseEtherTask(recipientAddress: string, web3: Web3) {\n return async () => {\n logUtils.log(`Processing ETH ${recipientAddress}`);\n const userBalance = await promisify(web3.eth.getBalance)(recipientAddress);\n const maxAmountInWei = new BigNumber(web3.toWei(DISPENSE_MAX_AMOUNT_ETHER, 'ether'));\n if (userBalance.greaterThanOrEqualTo(maxAmountInWei)) {\n logUtils.log(\n `User exceeded ETH balance maximum (${maxAmountInWei}) ${recipientAddress} ${userBalance} `,\n );\n return;\n }\n const sendTransactionAsync = promisify(web3.eth.sendTransaction);\n const txHash = await sendTransactionAsync({\n from: configs.DISPENSER_ADDRESS,\n to: recipientAddress,\n value: web3.toWei(DISPENSE_AMOUNT_ETHER, 'ether'),\n });\n logUtils.log(`Sent ${DISPENSE_AMOUNT_ETHER} ETH to ${recipientAddress} tx: ${txHash}`);\n };\n },\n dispenseTokenTask(recipientAddress: string, tokenSymbol: string, zeroEx: ZeroEx) {\n return async () => {\n logUtils.log(`Processing ${tokenSymbol} ${recipientAddress}`);\n const amountToDispense = new BigNumber(DISPENSE_AMOUNT_TOKEN);\n const token = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(tokenSymbol);\n if (_.isUndefined(token)) {\n throw new Error(`Unsupported asset type: ${tokenSymbol}`);\n }\n const baseUnitAmount = ZeroEx.toBaseUnitAmount(amountToDispense, token.decimals);\n const userBalanceBaseUnits = await zeroEx.token.getBalanceAsync(token.address, recipientAddress);\n const maxAmountBaseUnits = ZeroEx.toBaseUnitAmount(\n new BigNumber(DISPENSE_MAX_AMOUNT_TOKEN),\n token.decimals,\n );\n if (userBalanceBaseUnits.greaterThanOrEqualTo(maxAmountBaseUnits)) {\n logUtils.log(\n `User exceeded token balance maximum (${maxAmountBaseUnits}) ${recipientAddress} ${userBalanceBaseUnits} `,\n );\n return;\n }\n const txHash = await zeroEx.token.transferAsync(\n token.address,\n configs.DISPENSER_ADDRESS,\n recipientAddress,\n baseUnitAmount,\n );\n logUtils.log(`Sent ${amountToDispense} ZRX to ${recipientAddress} tx: ${txHash}`);\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/dispense_asset_tasks.ts","import { addressUtils } from '@0xproject/utils';\nimport { NextFunction, Request, Response } from 'express';\nimport * as _ from 'lodash';\n\nimport { configs } from './configs';\nimport { rpcUrls } from './rpc_urls';\n\nconst DEFAULT_NETWORK_ID = 42; // kovan\n\nexport const parameterTransformer = {\n transform(req: Request, res: Response, next: NextFunction) {\n const recipientAddress = req.params.recipient;\n if (_.isUndefined(recipientAddress) || !addressUtils.isAddress(recipientAddress)) {\n res.status(400).send('INVALID_RECIPIENT_ADDRESS');\n return;\n }\n const lowerCaseRecipientAddress = recipientAddress.toLowerCase();\n req.params.recipient = lowerCaseRecipientAddress;\n const networkId = _.get(req.query, 'networkId', DEFAULT_NETWORK_ID);\n const rpcUrlIfExists = _.get(rpcUrls, networkId);\n if (_.isUndefined(rpcUrlIfExists)) {\n res.status(400).send('UNSUPPORTED_NETWORK_ID');\n return;\n }\n req.params.networkId = networkId;\n next();\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/ts/parameter_transformer.ts"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/typescript-typings/types/web3-provider-engine/index.d.ts b/packages/typescript-typings/types/web3-provider-engine/index.d.ts index 15a8d0005..8d5aef749 100644 --- a/packages/typescript-typings/types/web3-provider-engine/index.d.ts +++ b/packages/typescript-typings/types/web3-provider-engine/index.d.ts @@ -1,8 +1,12 @@ declare module 'web3-provider-engine' { - class Web3ProviderEngine { + import { Provider, JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types'; + class Web3ProviderEngine implements Provider { public on(event: string, handler: () => void): void; - public send(payload: any): void; - public sendAsync(payload: any, callback: (error: any, response: any) => void): void; + public send(payload: JSONRPCRequestPayload): void; + public sendAsync( + payload: JSONRPCRequestPayload, + callback: (error: null | Error, response: JSONRPCResponsePayload) => void, + ): void; public addProvider(provider: any): void; public start(): void; public stop(): void; @@ -19,13 +23,13 @@ declare module 'web3-provider-engine/subproviders/subprovider' { export = Subprovider; } declare module 'web3-provider-engine/subproviders/rpc' { - import { JSONRPCRequestPayload } from '@0xproject/types'; + import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types'; class RpcSubprovider { constructor(options: { rpcUrl: string }); public handleRequest( payload: JSONRPCRequestPayload, next: () => void, - end: (err: Error | null, data?: any) => void, + end: (err: Error | null, data?: JSONRPCResponsePayload) => void, ): void; } export = RpcSubprovider; @@ -37,13 +41,13 @@ declare module 'web3-provider-engine/util/rpc-cache-utils' { export = ProviderEngineRpcUtils; } declare module 'web3-provider-engine/subproviders/fixture' { - import { JSONRPCRequestPayload } from '@0xproject/types'; + import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types'; class FixtureSubprovider { constructor(staticResponses: any); public handleRequest( payload: JSONRPCRequestPayload, next: () => void, - end: (err: Error | null, data?: any) => void, + end: (err: Error | null, data?: JSONRPCResponsePayload) => void, ): void; } export = FixtureSubprovider; -- cgit v1.2.3 From 56d1b0103f100c19ce0ee1572980b949161532f4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:38:43 -0700 Subject: Introduce CONFIG_FILE --- packages/contracts/test/utils/coverage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts index e3c5be428..58010e47f 100644 --- a/packages/contracts/test/utils/coverage.ts +++ b/packages/contracts/test/utils/coverage.ts @@ -14,7 +14,8 @@ export const coverage = { }, _getCoverageSubprovider(): CoverageSubprovider { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - const config = JSON.parse(fs.readFileSync('compiler.json').toString()); + const CONFIG_FILE = 'compiler.json'; + const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); }, -- cgit v1.2.3 From 8267950dbcc22bb6d572a9523bfa578f78f891f8 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:41:19 -0700 Subject: Assign then return --- packages/contracts/test/utils/coverage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts index 58010e47f..52c419ffc 100644 --- a/packages/contracts/test/utils/coverage.ts +++ b/packages/contracts/test/utils/coverage.ts @@ -17,6 +17,7 @@ export const coverage = { const CONFIG_FILE = 'compiler.json'; const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); - return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); + const coverageSubrpovider = new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); + return coverageSubprovider; }, }; -- cgit v1.2.3 From 6aafda45170d77f9e10025ce119d47d9710a87ec Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:42:37 -0700 Subject: Assign then pass --- packages/metacoin/test/utils/web3_wrapper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts index 9f6b155fc..724ed4e1f 100644 --- a/packages/metacoin/test/utils/web3_wrapper.ts +++ b/packages/metacoin/test/utils/web3_wrapper.ts @@ -25,7 +25,8 @@ provider.start(); const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); if (isCoverageEnabled) { - prependSubprovider(provider, coverage.getCoverageSubproviderSingleton()); + const coverageSubprovider = coverage.getCoverageSubproviderSingleton(); + prependSubprovider(provider, coverageSubprovider); } export const web3Wrapper = new Web3Wrapper(provider); -- cgit v1.2.3 From 86f17fb466124ad4ecd9e4ac47e7fecde8f585ee Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:44:25 -0700 Subject: Rename ZeroExArtifactAdapter to SolCompilerArtifactAdapter --- packages/contracts/test/utils/coverage.ts | 4 ++-- packages/metacoin/test/utils/coverage.ts | 4 ++-- packages/sol-cov/src/artifact_adapters/0x.ts | 2 +- packages/sol-cov/src/artifact_adapters/truffle.ts | 6 +++--- packages/sol-cov/src/index.ts | 2 +- packages/sol-cov/test/collect_contracts_data_test.ts | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts index 52c419ffc..eeb47667f 100644 --- a/packages/contracts/test/utils/coverage.ts +++ b/packages/contracts/test/utils/coverage.ts @@ -1,5 +1,5 @@ import { devConstants } from '@0xproject/dev-utils'; -import { CoverageSubprovider, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; +import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -16,7 +16,7 @@ export const coverage = { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; const CONFIG_FILE = 'compiler.json'; const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); - const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); + const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir); const coverageSubrpovider = new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); return coverageSubprovider; }, diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts index 83b56596f..945afb0a7 100644 --- a/packages/metacoin/test/utils/coverage.ts +++ b/packages/metacoin/test/utils/coverage.ts @@ -1,5 +1,5 @@ import { devConstants } from '@0xproject/dev-utils'; -import { CoverageSubprovider, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; +import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov'; import * as _ from 'lodash'; import { config } from './config'; @@ -15,7 +15,7 @@ export const coverage = { }, _getCoverageSubprovider(): CoverageSubprovider { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); + const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir); return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); }, }; diff --git a/packages/sol-cov/src/artifact_adapters/0x.ts b/packages/sol-cov/src/artifact_adapters/0x.ts index 87d23b0aa..f61364df6 100644 --- a/packages/sol-cov/src/artifact_adapters/0x.ts +++ b/packages/sol-cov/src/artifact_adapters/0x.ts @@ -7,7 +7,7 @@ import { ContractData } from '../types'; import { AbstractArtifactAdapter } from './abstract'; -export class ZeroExArtifactAdapter extends AbstractArtifactAdapter { +export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { private _artifactsPath: string; private _sourcesPath: string; constructor(artifactsPath: string, sourcesPath: string) { diff --git a/packages/sol-cov/src/artifact_adapters/truffle.ts b/packages/sol-cov/src/artifact_adapters/truffle.ts index e891bb464..b9c9c4d42 100644 --- a/packages/sol-cov/src/artifact_adapters/truffle.ts +++ b/packages/sol-cov/src/artifact_adapters/truffle.ts @@ -7,7 +7,7 @@ import * as rimraf from 'rimraf'; import { ContractData } from '../types'; -import { ZeroExArtifactAdapter } from './0x'; +import { SolCompilerArtifactAdapter } from './0x'; import { AbstractArtifactAdapter } from './abstract'; export class TruffleArtifactAdapter extends AbstractArtifactAdapter { @@ -35,8 +35,8 @@ export class TruffleArtifactAdapter extends AbstractArtifactAdapter { }; const compiler = new Compiler(compilerOptions); await compiler.compileAsync(); - const zeroExArtifactAdapter = new ZeroExArtifactAdapter(artifactsDir, this._sourcesPath); - const contractsDataFrom0xArtifacts = await zeroExArtifactAdapter.collectContractsDataAsync(); + const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, this._sourcesPath); + const contractsDataFrom0xArtifacts = await solCompilerArtifactAdapter.collectContractsDataAsync(); rimraf.sync(artifactsDir); return contractsDataFrom0xArtifacts; } diff --git a/packages/sol-cov/src/index.ts b/packages/sol-cov/src/index.ts index 18031372b..a4d2b027f 100644 --- a/packages/sol-cov/src/index.ts +++ b/packages/sol-cov/src/index.ts @@ -1,5 +1,5 @@ export { CoverageSubprovider } from './coverage_subprovider'; -export { ZeroExArtifactAdapter } from './artifact_adapters/0x'; +export { SolCompilerArtifactAdapter } from './artifact_adapters/0x'; export { TruffleArtifactAdapter } from './artifact_adapters/truffle'; export { AbstractArtifactAdapter } from './artifact_adapters/abstract'; export { ContractData } from './types'; diff --git a/packages/sol-cov/test/collect_contracts_data_test.ts b/packages/sol-cov/test/collect_contracts_data_test.ts index 906b7f4e2..7a0b9fef5 100644 --- a/packages/sol-cov/test/collect_contracts_data_test.ts +++ b/packages/sol-cov/test/collect_contracts_data_test.ts @@ -4,7 +4,7 @@ import 'make-promises-safe'; import 'mocha'; import * as path from 'path'; -import { ZeroExArtifactAdapter } from '../src/artifact_adapters/0x'; +import { SolCompilerArtifactAdapter } from '../src/artifact_adapters/0x'; const expect = chai.expect; @@ -13,7 +13,7 @@ describe('Collect contracts data', () => { it('correctly collects contracts data', async () => { const artifactsPath = path.resolve(__dirname, 'fixtures/artifacts'); const sourcesPath = path.resolve(__dirname, 'fixtures/contracts'); - const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(artifactsPath, sourcesPath); + const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(artifactsPath, sourcesPath); const contractsData = await zeroExArtifactsAdapter.collectContractsDataAsync(); _.forEach(contractsData, contractData => { expect(contractData).to.have.keys([ -- cgit v1.2.3 From ac925aa22685a1ea412feddb760cf21022ef84c0 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:45:38 -0700 Subject: Improve a CHANGELOG comment --- packages/sol-compiler/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index 35f2c6179..b71135ea7 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -7,7 +7,7 @@ "pr": 588 }, { - "note": "Add a possibility to define a solidity version to use", + "note": "Add the ability to define a specific solidity version", "pr": 589 } ] -- cgit v1.2.3 From 334ef5c3eb1cba0b6872c41faaac96f08a4b2a3e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:46:28 -0700 Subject: Improve a CHANGELOG comment --- packages/sol-cov/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index 9c978df5a..5572c5845 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -7,7 +7,7 @@ "pr": 589 }, { - "note": "Implement ZeroExArtiactAdapter and TruffleArtifactAdapter", + "note": "Implement SolCompilerArtifactAdapter and TruffleArtifactAdapter", "pr": 589 }, { -- cgit v1.2.3 From 08b08ef1d0fbff2da8b64524704cf1bc50f77f30 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:56:00 -0700 Subject: Match class names with file names --- packages/sol-cov/src/artifact_adapters/0x.ts | 41 --------------------- packages/sol-cov/src/artifact_adapters/abstract.ts | 5 --- .../artifact_adapters/abstract_artifact_adapter.ts | 5 +++ .../sol_compiler_artifact_adapter.ts | 41 +++++++++++++++++++++ packages/sol-cov/src/artifact_adapters/truffle.ts | 43 ---------------------- .../artifact_adapters/truffle_artifact_adapter.ts | 43 ++++++++++++++++++++++ packages/sol-cov/src/index.ts | 6 +-- 7 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 packages/sol-cov/src/artifact_adapters/0x.ts delete mode 100644 packages/sol-cov/src/artifact_adapters/abstract.ts create mode 100644 packages/sol-cov/src/artifact_adapters/abstract_artifact_adapter.ts create mode 100644 packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts delete mode 100644 packages/sol-cov/src/artifact_adapters/truffle.ts create mode 100644 packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts diff --git a/packages/sol-cov/src/artifact_adapters/0x.ts b/packages/sol-cov/src/artifact_adapters/0x.ts deleted file mode 100644 index f61364df6..000000000 --- a/packages/sol-cov/src/artifact_adapters/0x.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as fs from 'fs'; -import * as glob from 'glob'; -import * as _ from 'lodash'; -import * as path from 'path'; - -import { ContractData } from '../types'; - -import { AbstractArtifactAdapter } from './abstract'; - -export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { - private _artifactsPath: string; - private _sourcesPath: string; - constructor(artifactsPath: string, sourcesPath: string) { - super(); - this._artifactsPath = artifactsPath; - this._sourcesPath = sourcesPath; - } - public async collectContractsDataAsync(): Promise { - const artifactsGlob = `${this._artifactsPath}/**/*.json`; - const artifactFileNames = glob.sync(artifactsGlob, { absolute: true }); - const contractsData: ContractData[] = []; - for (const artifactFileName of artifactFileNames) { - const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString()); - let sources = _.keys(artifact.sources); - sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath)); - const contractName = artifact.contractName; - // We don't compute coverage for dependencies - const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString()); - const contractData = { - sourceCodes, - sources, - bytecode: artifact.compilerOutput.evm.bytecode.object, - sourceMap: artifact.compilerOutput.evm.bytecode.sourceMap, - runtimeBytecode: artifact.compilerOutput.evm.deployedBytecode.object, - sourceMapRuntime: artifact.compilerOutput.evm.deployedBytecode.sourceMap, - }; - contractsData.push(contractData); - } - return contractsData; - } -} diff --git a/packages/sol-cov/src/artifact_adapters/abstract.ts b/packages/sol-cov/src/artifact_adapters/abstract.ts deleted file mode 100644 index fcc6562ad..000000000 --- a/packages/sol-cov/src/artifact_adapters/abstract.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ContractData } from '../types'; - -export abstract class AbstractArtifactAdapter { - public abstract async collectContractsDataAsync(): Promise; -} diff --git a/packages/sol-cov/src/artifact_adapters/abstract_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/abstract_artifact_adapter.ts new file mode 100644 index 000000000..fcc6562ad --- /dev/null +++ b/packages/sol-cov/src/artifact_adapters/abstract_artifact_adapter.ts @@ -0,0 +1,5 @@ +import { ContractData } from '../types'; + +export abstract class AbstractArtifactAdapter { + public abstract async collectContractsDataAsync(): Promise; +} diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts new file mode 100644 index 000000000..f61364df6 --- /dev/null +++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts @@ -0,0 +1,41 @@ +import * as fs from 'fs'; +import * as glob from 'glob'; +import * as _ from 'lodash'; +import * as path from 'path'; + +import { ContractData } from '../types'; + +import { AbstractArtifactAdapter } from './abstract'; + +export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { + private _artifactsPath: string; + private _sourcesPath: string; + constructor(artifactsPath: string, sourcesPath: string) { + super(); + this._artifactsPath = artifactsPath; + this._sourcesPath = sourcesPath; + } + public async collectContractsDataAsync(): Promise { + const artifactsGlob = `${this._artifactsPath}/**/*.json`; + const artifactFileNames = glob.sync(artifactsGlob, { absolute: true }); + const contractsData: ContractData[] = []; + for (const artifactFileName of artifactFileNames) { + const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString()); + let sources = _.keys(artifact.sources); + sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath)); + const contractName = artifact.contractName; + // We don't compute coverage for dependencies + const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString()); + const contractData = { + sourceCodes, + sources, + bytecode: artifact.compilerOutput.evm.bytecode.object, + sourceMap: artifact.compilerOutput.evm.bytecode.sourceMap, + runtimeBytecode: artifact.compilerOutput.evm.deployedBytecode.object, + sourceMapRuntime: artifact.compilerOutput.evm.deployedBytecode.sourceMap, + }; + contractsData.push(contractData); + } + return contractsData; + } +} diff --git a/packages/sol-cov/src/artifact_adapters/truffle.ts b/packages/sol-cov/src/artifact_adapters/truffle.ts deleted file mode 100644 index b9c9c4d42..000000000 --- a/packages/sol-cov/src/artifact_adapters/truffle.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Compiler, CompilerOptions } from '@0xproject/sol-compiler'; -import * as fs from 'fs'; -import * as glob from 'glob'; -import * as _ from 'lodash'; -import * as path from 'path'; -import * as rimraf from 'rimraf'; - -import { ContractData } from '../types'; - -import { SolCompilerArtifactAdapter } from './0x'; -import { AbstractArtifactAdapter } from './abstract'; - -export class TruffleArtifactAdapter extends AbstractArtifactAdapter { - private _solcVersion: string; - private _sourcesPath: string; - constructor(sourcesPath: string, solcVersion: string) { - super(); - this._solcVersion = solcVersion; - this._sourcesPath = sourcesPath; - } - public async collectContractsDataAsync(): Promise { - const artifactsDir = '0x-artifacts'; - const compilerOptions: CompilerOptions = { - contractsDir: this._sourcesPath, - artifactsDir, - compilerSettings: { - outputSelection: { - ['*']: { - ['*']: ['abi', 'evm.bytecode.object', 'evm.deployedBytecode.object'], - }, - }, - }, - contracts: '*', - solcVersion: this._solcVersion, - }; - const compiler = new Compiler(compilerOptions); - await compiler.compileAsync(); - const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, this._sourcesPath); - const contractsDataFrom0xArtifacts = await solCompilerArtifactAdapter.collectContractsDataAsync(); - rimraf.sync(artifactsDir); - return contractsDataFrom0xArtifacts; - } -} diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts new file mode 100644 index 000000000..b9c9c4d42 --- /dev/null +++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts @@ -0,0 +1,43 @@ +import { Compiler, CompilerOptions } from '@0xproject/sol-compiler'; +import * as fs from 'fs'; +import * as glob from 'glob'; +import * as _ from 'lodash'; +import * as path from 'path'; +import * as rimraf from 'rimraf'; + +import { ContractData } from '../types'; + +import { SolCompilerArtifactAdapter } from './0x'; +import { AbstractArtifactAdapter } from './abstract'; + +export class TruffleArtifactAdapter extends AbstractArtifactAdapter { + private _solcVersion: string; + private _sourcesPath: string; + constructor(sourcesPath: string, solcVersion: string) { + super(); + this._solcVersion = solcVersion; + this._sourcesPath = sourcesPath; + } + public async collectContractsDataAsync(): Promise { + const artifactsDir = '0x-artifacts'; + const compilerOptions: CompilerOptions = { + contractsDir: this._sourcesPath, + artifactsDir, + compilerSettings: { + outputSelection: { + ['*']: { + ['*']: ['abi', 'evm.bytecode.object', 'evm.deployedBytecode.object'], + }, + }, + }, + contracts: '*', + solcVersion: this._solcVersion, + }; + const compiler = new Compiler(compilerOptions); + await compiler.compileAsync(); + const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, this._sourcesPath); + const contractsDataFrom0xArtifacts = await solCompilerArtifactAdapter.collectContractsDataAsync(); + rimraf.sync(artifactsDir); + return contractsDataFrom0xArtifacts; + } +} diff --git a/packages/sol-cov/src/index.ts b/packages/sol-cov/src/index.ts index a4d2b027f..7a2afbe80 100644 --- a/packages/sol-cov/src/index.ts +++ b/packages/sol-cov/src/index.ts @@ -1,5 +1,5 @@ export { CoverageSubprovider } from './coverage_subprovider'; -export { SolCompilerArtifactAdapter } from './artifact_adapters/0x'; -export { TruffleArtifactAdapter } from './artifact_adapters/truffle'; -export { AbstractArtifactAdapter } from './artifact_adapters/abstract'; +export { SolCompilerArtifactAdapter } from './artifact_adapters/sol_compiler_artifact_adapter'; +export { TruffleArtifactAdapter } from './artifact_adapters/truffle_artifact_adapter'; +export { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter'; export { ContractData } from './types'; -- cgit v1.2.3 From d9907f227e2187441b5496e26d166fc7e289cdc6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 17:00:10 -0700 Subject: Use a hidden directory for temp artifacts --- packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts | 1 - packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts index f61364df6..138c35b1e 100644 --- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts @@ -24,7 +24,6 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { let sources = _.keys(artifact.sources); sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath)); const contractName = artifact.contractName; - // We don't compute coverage for dependencies const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString()); const contractData = { sourceCodes, diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts index b9c9c4d42..36a31383d 100644 --- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts @@ -19,7 +19,7 @@ export class TruffleArtifactAdapter extends AbstractArtifactAdapter { this._sourcesPath = sourcesPath; } public async collectContractsDataAsync(): Promise { - const artifactsDir = '0x-artifacts'; + const artifactsDir = '.0x-artifacts'; const compilerOptions: CompilerOptions = { contractsDir: this._sourcesPath, artifactsDir, -- cgit v1.2.3 From 5c9bde203e0d9726f77f910adcf386c5758df072 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 17:01:55 -0700 Subject: Remove a comment --- packages/sol-cov/src/coverage_manager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index 65a6086c0..1adddbbd6 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -122,7 +122,6 @@ export class CoverageManager { this._verbose = verbose; } public appendTraceInfo(traceInfo: TraceInfo): void { - // console.log(JSON.stringify(traceInfo, null, '\n')); this._traceInfos.push(traceInfo); } public async writeCoverageAsync(): Promise { -- cgit v1.2.3 From e4fe4975041f6fd28b84085ce5083dd1c4cb3b22 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 17:23:01 -0700 Subject: Refactor ContractData lookup --- .../artifact_adapters/truffle_artifact_adapter.ts | 4 +- packages/sol-cov/src/coverage_manager.ts | 63 +++++++++++----------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts index 36a31383d..c7f21b6eb 100644 --- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts @@ -7,8 +7,8 @@ import * as rimraf from 'rimraf'; import { ContractData } from '../types'; -import { SolCompilerArtifactAdapter } from './0x'; -import { AbstractArtifactAdapter } from './abstract'; +import { AbstractArtifactAdapter } from './abstract_artifact_adapter'; +import { SolCompilerArtifactAdapter } from './sol_compiler_artifact_adapter'; export class TruffleArtifactAdapter extends AbstractArtifactAdapter { private _solcVersion: string; diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index 1adddbbd6..d7a00f86d 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -1,12 +1,12 @@ import { promisify } from '@0xproject/utils'; -import { addHexPrefix } from 'ethereumjs-util'; +import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import { Collector } from 'istanbul'; import * as _ from 'lodash'; import * as mkdirp from 'mkdirp'; import * as path from 'path'; -import { AbstractArtifactAdapter } from './artifact_adapters/abstract'; +import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter'; import { collectCoverageEntries } from './collect_coverage_entries'; import { constants } from './constants'; import { parseSourceMap } from './source_maps'; @@ -112,6 +112,29 @@ export class CoverageManager { }; return partialCoverage; } + private static _bytecodeToBytecodeRegex(bytecode: string): string { + const bytecodeRegex = bytecode + // Library linking placeholder: __ConvertLib____________________________ + .replace(/_.*_/, '.*') + // Last 86 characters is solidity compiler metadata that's different between compilations + .replace(/.{86}$/, '') + // Libraries contain their own address at the beginning of the code and it's impossible to know it in advance + .replace(/^0x730000000000000000000000000000000000000000/, '0x73........................................'); + return bytecodeRegex; + } + private static _getContractDataIfExists(contractsData: ContractData[], bytecode: string): ContractData | undefined { + if (!bytecode.startsWith('0x')) { + throw new Error(')x missing'); + } + const contractData = _.find(contractsData, contractDataCandidate => { + const bytecodeRegex = CoverageManager._bytecodeToBytecodeRegex(contractDataCandidate.bytecode); + const runtimeBytecodeRegex = CoverageManager._bytecodeToBytecodeRegex( + contractDataCandidate.runtimeBytecode, + ); + return !_.isNull(bytecode.match(bytecodeRegex)) || !_.isNull(bytecode.match(runtimeBytecodeRegex)); + }); + return contractData; + } constructor( artifactAdapter: AbstractArtifactAdapter, getContractCodeAsync: (address: string) => Promise, @@ -136,20 +159,8 @@ export class CoverageManager { for (const traceInfo of this._traceInfos) { if (traceInfo.address !== constants.NEW_CONTRACT) { // Runtime transaction - let runtimeBytecode = (traceInfo as TraceInfoExistingContract).runtimeBytecode; - runtimeBytecode = addHexPrefix(runtimeBytecode); - const contractData = _.find(contractsData, contractDataCandidate => { - // Library linking placeholder: __ConvertLib____________________________ - let runtimeBytecodeRegex = contractDataCandidate.runtimeBytecode.replace(/_.*_/, '.*'); - // Last 86 characters is solidity compiler metadata that's different between compilations - runtimeBytecodeRegex = runtimeBytecodeRegex.replace(/.{86}$/, ''); - // Libraries contain their own address at the beginning of the code and it's impossible to know it in advance - runtimeBytecodeRegex = runtimeBytecodeRegex.replace( - /^0x730000000000000000000000000000000000000000/, - '0x73........................................', - ); - return !_.isNull(runtimeBytecode.match(runtimeBytecodeRegex)); - }) as ContractData; + const runtimeBytecode = (traceInfo as TraceInfoExistingContract).runtimeBytecode; + const contractData = CoverageManager._getContractDataIfExists(contractsData, runtimeBytecode); if (_.isUndefined(contractData)) { if (this._verbose) { // tslint:disable-next-line:no-console @@ -157,7 +168,7 @@ export class CoverageManager { } continue; } - const bytecodeHex = runtimeBytecode.slice(2); + const bytecodeHex = stripHexPrefix(runtimeBytecode); const sourceMap = contractData.sourceMapRuntime; const pcToSourceRange = parseSourceMap( contractData.sourceCodes, @@ -176,20 +187,8 @@ export class CoverageManager { } } else { // Contract creation transaction - let bytecode = (traceInfo as TraceInfoNewContract).bytecode; - bytecode = addHexPrefix(bytecode); - const contractData = _.find(contractsData, contractDataCandidate => { - // Library linking placeholder: __ConvertLib____________________________ - let bytecodeRegex = contractDataCandidate.bytecode.replace(/_.*_/, '.*'); - // Last 86 characters is solidity compiler metadata that's different between compilations - bytecodeRegex = bytecodeRegex.replace(/.{86}$/, ''); - // Libraries contain their own address at the beginning of the code and it's impossible to know it in advance - bytecodeRegex = bytecodeRegex.replace( - /^0x730000000000000000000000000000000000000000/, - '0x73........................................', - ); - return !_.isNull(bytecode.match(bytecodeRegex)); - }) as ContractData; + const bytecode = (traceInfo as TraceInfoNewContract).bytecode; + const contractData = CoverageManager._getContractDataIfExists(contractsData, bytecode); if (_.isUndefined(contractData)) { if (this._verbose) { // tslint:disable-next-line:no-console @@ -197,7 +196,7 @@ export class CoverageManager { } continue; } - const bytecodeHex = bytecode.slice(2); + const bytecodeHex = stripHexPrefix(bytecode); const sourceMap = contractData.sourceMap; const pcToSourceRange = parseSourceMap( contractData.sourceCodes, -- cgit v1.2.3 From 253bada6432bb4727de2e9d21658cd2c7a2c01b7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 17:30:38 -0700 Subject: Fix import paths --- packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts | 2 +- packages/sol-cov/src/coverage_subprovider.ts | 2 +- packages/sol-cov/test/collect_contracts_data_test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts index 138c35b1e..cb164f769 100644 --- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts @@ -5,7 +5,7 @@ import * as path from 'path'; import { ContractData } from '../types'; -import { AbstractArtifactAdapter } from './abstract'; +import { AbstractArtifactAdapter } from './abstract_artifact_adapter'; export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { private _artifactsPath: string; diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index addad5e8f..1e050080f 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; -import { AbstractArtifactAdapter } from './artifact_adapters/abstract'; +import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter'; import { constants } from './constants'; import { CoverageManager } from './coverage_manager'; import { getTracesByContractAddress } from './trace'; diff --git a/packages/sol-cov/test/collect_contracts_data_test.ts b/packages/sol-cov/test/collect_contracts_data_test.ts index 7a0b9fef5..d423bc603 100644 --- a/packages/sol-cov/test/collect_contracts_data_test.ts +++ b/packages/sol-cov/test/collect_contracts_data_test.ts @@ -4,7 +4,7 @@ import 'make-promises-safe'; import 'mocha'; import * as path from 'path'; -import { SolCompilerArtifactAdapter } from '../src/artifact_adapters/0x'; +import { SolCompilerArtifactAdapter } from '../src/artifact_adapters/sol_compiler_artifact_adapter'; const expect = chai.expect; -- cgit v1.2.3 From 2f35e4789c5a41e25a97896bab68ac73b8ba3d28 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 09:50:37 -0700 Subject: Change publish command name --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2d44e468e..48ff3939a 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc", "report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls", "test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js", - "publish": "run-s install:all rebuild script:publish", - "publish:dry": "run-s install:all rebuild script:publish:dry", + "run:publish": "run-s install:all rebuild script:publish", + "run:publish:dry": "run-s install:all rebuild script:publish:dry", "script:publish": "node ./packages/monorepo-scripts/lib/publish.js", "script:publish:dry": "IS_DRY_RUN=true yarn script:publish", "install:all": "yarn install", -- cgit v1.2.3 From f8c628b0c7b750e1096dcc507190525feb8bd572 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:16:38 -0700 Subject: Updated CHANGELOGS --- packages/0x.js/CHANGELOG.json | 3 ++- packages/0x.js/CHANGELOG.md | 7 ++++++- packages/abi-gen/CHANGELOG.json | 3 ++- packages/abi-gen/CHANGELOG.md | 6 +++++- packages/assert/CHANGELOG.json | 9 +++++++++ packages/assert/CHANGELOG.md | 6 +++++- packages/base-contract/CHANGELOG.json | 9 +++++++++ packages/base-contract/CHANGELOG.md | 6 +++++- packages/connect/CHANGELOG.json | 9 +++++++++ packages/connect/CHANGELOG.md | 6 +++++- packages/contract-wrappers/CHANGELOG.json | 10 ++++++++++ packages/contract-wrappers/CHANGELOG.md | 8 ++++++++ packages/dev-utils/CHANGELOG.json | 3 ++- packages/dev-utils/CHANGELOG.md | 6 +++++- packages/fill-scenarios/CHANGELOG.json | 10 ++++++++++ packages/fill-scenarios/CHANGELOG.md | 14 ++++++++++++++ packages/json-schemas/CHANGELOG.json | 9 +++++++++ packages/json-schemas/CHANGELOG.md | 6 +++++- packages/migrations/CHANGELOG.json | 9 +++++++++ packages/migrations/CHANGELOG.md | 6 +++++- packages/monorepo-scripts/CHANGELOG.json | 9 +++++++++ packages/monorepo-scripts/CHANGELOG.md | 4 ++++ packages/order-utils/CHANGELOG.json | 6 ++---- packages/order-utils/CHANGELOG.md | 6 +++++- packages/order-watcher/CHANGELOG.json | 10 ++++++++++ packages/order-watcher/CHANGELOG.md | 14 ++++++++++++++ packages/react-docs/CHANGELOG.json | 9 +++++++++ packages/react-docs/CHANGELOG.md | 6 +++++- packages/react-shared/CHANGELOG.json | 9 +++++++++ packages/react-shared/CHANGELOG.md | 6 +++++- packages/sol-compiler/CHANGELOG.json | 3 ++- packages/sol-compiler/CHANGELOG.md | 6 +++++- packages/sol-cov/CHANGELOG.json | 9 +++++++++ packages/sol-cov/CHANGELOG.md | 6 +++++- packages/sol-resolver/CHANGELOG.json | 9 +++++++++ packages/sol-resolver/CHANGELOG.md | 6 +++++- packages/sra-report/CHANGELOG.json | 3 ++- packages/sra-report/CHANGELOG.md | 6 +++++- packages/subproviders/CHANGELOG.json | 9 +++++++++ packages/subproviders/CHANGELOG.md | 6 +++++- packages/tslint-config/CHANGELOG.json | 9 +++++++++ packages/tslint-config/CHANGELOG.md | 4 ++++ packages/types/CHANGELOG.json | 3 ++- packages/types/CHANGELOG.md | 6 +++++- packages/typescript-typings/CHANGELOG.json | 9 +++++++++ packages/typescript-typings/CHANGELOG.md | 6 +++++- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 6 +++++- packages/web3-wrapper/CHANGELOG.json | 9 +++++++++ packages/web3-wrapper/CHANGELOG.md | 6 +++++- 50 files changed, 324 insertions(+), 30 deletions(-) create mode 100644 packages/fill-scenarios/CHANGELOG.md create mode 100644 packages/order-watcher/CHANGELOG.md diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index 5e4a726b1..2a219180d 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -11,7 +11,8 @@ "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage", "pr": 579 } - ] + ], + "timestamp": 1527008270 }, { "timestamp": 1525477860, diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index 353e0de29..f7ceaa552 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -5,7 +5,12 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.37.2 - _May 5, 2018_ +## v0.38.0 - _May 22, 2018_ + + * Renamed createOrderStateWatcher to createOrderWatcherAsync since it is now async (#579) + * Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage (#579) + +## v0.37.2 - _May 4, 2018_ * Dependencies updated diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index 4b23b8118..71cbaac1e 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Properly export the executable binary", "pr": 588 } - ] + ], + "timestamp": 1527008270 }, { "timestamp": 1525477860, diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index 803414e14..bcd807a3c 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.2.13 - _May 5, 2018_ +## v0.3.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.2.13 - _May 4, 2018_ * Dependencies updated diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index f826c7675..048763732 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008270, + "version": "0.2.10", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.2.9", diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md index ab058b9fc..974ac5c42 100644 --- a/packages/assert/CHANGELOG.md +++ b/packages/assert/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.2.9 - _May 5, 2018_ +## v0.2.10 - _May 22, 2018_ + + * Dependencies updated + +## v0.2.9 - _May 4, 2018_ * Dependencies updated diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index 106c26989..04029576c 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008270, + "version": "0.3.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.3.1", diff --git a/packages/base-contract/CHANGELOG.md b/packages/base-contract/CHANGELOG.md index b57bd5fc0..90ad066b5 100644 --- a/packages/base-contract/CHANGELOG.md +++ b/packages/base-contract/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.3.1 - _May 5, 2018_ +## v0.3.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.3.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index dd172e975..58fcc635b 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008270, + "version": "0.6.13", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.6.12", diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 4e118de38..acc6f33bd 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.12 - _May 5, 2018_ +## v0.6.13 - _May 22, 2018_ + + * Dependencies updated + +## v0.6.12 - _May 4, 2018_ * Dependencies updated diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 18ca4143e..84e773933 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "version": "0.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1527008544 + }, + { + "timestamp": 1527008270, "version": "0.0.1", "changes": [ { diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md index 5565d6210..c8a0145d5 100644 --- a/packages/contract-wrappers/CHANGELOG.md +++ b/packages/contract-wrappers/CHANGELOG.md @@ -4,3 +4,11 @@ Edit the package's CHANGELOG.json file only. --> CHANGELOG + +## v0.0.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.1 - _May 22, 2018_ + + * Moved contractWrappers out of 0x.js (#579) diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index 72ecdbabb..4f6f7bd76 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -10,7 +10,8 @@ "note": "Move callbackErrorReporter over from 0x.js", "pr": 579 } - ] + ], + "timestamp": 1527008544 }, { "timestamp": 1525477860, diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index ab824c898..8e2f007d2 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.4.1 - _May 5, 2018_ +## v0.4.2 - _May 22, 2018_ + + * Move callbackErrorReporter over from 0x.js (#579) + +## v0.4.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json index 3cbba3ecb..c97cc7dd8 100644 --- a/packages/fill-scenarios/CHANGELOG.json +++ b/packages/fill-scenarios/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "timestamp": 1527008544, + "version": "0.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1527008544, "version": "0.0.1", "changes": [ { diff --git a/packages/fill-scenarios/CHANGELOG.md b/packages/fill-scenarios/CHANGELOG.md new file mode 100644 index 000000000..b32b8a289 --- /dev/null +++ b/packages/fill-scenarios/CHANGELOG.md @@ -0,0 +1,14 @@ + + +CHANGELOG + +## v0.0.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.1 - _May 22, 2018_ + + * Move FillScenarios out of 0x.js (#579) diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 4114cdcf4..ea0df7eb7 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008794, + "version": "0.7.24", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.7.23", diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index 257d14fdf..0b35f2408 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.7.23 - _May 5, 2018_ +## v0.7.24 - _May 22, 2018_ + + * Dependencies updated + +## v0.7.23 - _May 4, 2018_ * Dependencies updated diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 142468dad..f22d4a77f 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008794, + "version": "0.0.6", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.5", diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md index 99da91a35..78d915b6c 100644 --- a/packages/migrations/CHANGELOG.md +++ b/packages/migrations/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.5 - _May 5, 2018_ +## v0.0.6 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.5 - _May 4, 2018_ * Dependencies updated diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json index 10fe8acb1..58d946cd6 100644 --- a/packages/monorepo-scripts/CHANGELOG.json +++ b/packages/monorepo-scripts/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527008794, + "version": "0.1.20", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525428773, "version": "0.1.19", diff --git a/packages/monorepo-scripts/CHANGELOG.md b/packages/monorepo-scripts/CHANGELOG.md index df70792b8..db5afd5af 100644 --- a/packages/monorepo-scripts/CHANGELOG.md +++ b/packages/monorepo-scripts/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.1.20 - _May 22, 2018_ + + * Dependencies updated + ## v0.1.19 - _May 4, 2018_ * Dependencies updated diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index 9399379fa..1bdb25347 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -3,13 +3,11 @@ "version": "0.0.5", "changes": [ { - "note": "Add formatters package for converting signedOrder to orderAddresses & orderValues", - "note": "Add RemainingFillableCalculator to calculate the remaining fillable amount of an order", - "note": "Add AbstractBalanceAndProxyAllowanceFetcher and AbstractOrderFilledCancelledFetcher", "note": "Add orderStateUtils, a module for computing order state needed to decide if an order is still valid" } - ] + ], + "timestamp": 1527008794 }, { "timestamp": 1525477860, diff --git a/packages/order-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md index d0bb706aa..5b10c13bc 100644 --- a/packages/order-utils/CHANGELOG.md +++ b/packages/order-utils/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.4 - _May 5, 2018_ +## v0.0.5 - _May 22, 2018_ + + * Add orderStateUtils, a module for computing order state needed to decide if an order is still valid + +## v0.0.4 - _May 4, 2018_ * Dependencies updated diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 87f40bcb7..dde78445a 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "timestamp": 1527008794, + "version": "0.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1527008794, "version": "0.0.1", "changes": [ { diff --git a/packages/order-watcher/CHANGELOG.md b/packages/order-watcher/CHANGELOG.md new file mode 100644 index 000000000..999d62f44 --- /dev/null +++ b/packages/order-watcher/CHANGELOG.md @@ -0,0 +1,14 @@ + + +CHANGELOG + +## v0.0.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.1 - _May 22, 2018_ + + * Moved OrderWatcher out of 0x.js package (#579) diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 0cb767dfc..32fa49264 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.0.12", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.11", diff --git a/packages/react-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md index 8a0afbeed..e46198f6c 100644 --- a/packages/react-docs/CHANGELOG.md +++ b/packages/react-docs/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.11 - _May 5, 2018_ +## v0.0.12 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.11 - _May 4, 2018_ * Dependencies updated diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json index 3e03f81f1..5227bbf72 100644 --- a/packages/react-shared/CHANGELOG.json +++ b/packages/react-shared/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.1.7", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "0.2.0", "changes": [ diff --git a/packages/react-shared/CHANGELOG.md b/packages/react-shared/CHANGELOG.md index 51d804b63..68eac96cf 100644 --- a/packages/react-shared/CHANGELOG.md +++ b/packages/react-shared/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.1.6 - _May 5, 2018_ +## v0.1.7 - _May 22, 2018_ + + * Dependencies updated + +## v0.1.6 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index b71135ea7..33fd99e4f 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -10,7 +10,8 @@ "note": "Add the ability to define a specific solidity version", "pr": 589 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/sol-compiler/CHANGELOG.md b/packages/sol-compiler/CHANGELOG.md index 4eb0ed453..ee9b53f4e 100644 --- a/packages/sol-compiler/CHANGELOG.md +++ b/packages/sol-compiler/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.4.3 - _May 5, 2018_ +## v0.5.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.4.3 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index 5572c5845..f49e36525 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -20,6 +20,15 @@ } ] }, + { + "timestamp": 1527009133, + "version": "0.0.11", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.10", diff --git a/packages/sol-cov/CHANGELOG.md b/packages/sol-cov/CHANGELOG.md index 9e2995328..f0312d297 100644 --- a/packages/sol-cov/CHANGELOG.md +++ b/packages/sol-cov/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.10 - _May 5, 2018_ +## v0.0.11 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.10 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index eb52d85e0..6d5917212 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -12,6 +12,15 @@ } ] }, + { + "timestamp": 1527009133, + "version": "0.0.5", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.0.4", diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md index 4780544fa..bd94b1b41 100644 --- a/packages/sol-resolver/CHANGELOG.md +++ b/packages/sol-resolver/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.4 - _May 5, 2018_ +## v0.0.5 - _May 22, 2018_ + + * Dependencies updated + +## v0.0.4 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sra-report/CHANGELOG.json b/packages/sra-report/CHANGELOG.json index 90a807c85..015279157 100644 --- a/packages/sra-report/CHANGELOG.json +++ b/packages/sra-report/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Properly export the executable binary", "pr": 588 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/sra-report/CHANGELOG.md b/packages/sra-report/CHANGELOG.md index e390e76ef..208a1e174 100644 --- a/packages/sra-report/CHANGELOG.md +++ b/packages/sra-report/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.0.14 - _May 5, 2018_ +## v0.1.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.0.14 - _May 4, 2018_ * Dependencies updated diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json index 799c2c99a..d3bf79ac4 100644 --- a/packages/subproviders/CHANGELOG.json +++ b/packages/subproviders/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.10.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.10.1", diff --git a/packages/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md index 22a5f90e8..8c4990a7c 100644 --- a/packages/subproviders/CHANGELOG.md +++ b/packages/subproviders/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.10.1 - _May 5, 2018_ +## v0.10.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.10.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json index ac59f7b19..4868b3983 100644 --- a/packages/tslint-config/CHANGELOG.json +++ b/packages/tslint-config/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.4.18", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525428773, "version": "0.4.17", diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md index 6f5042a52..56b65cadd 100644 --- a/packages/tslint-config/CHANGELOG.md +++ b/packages/tslint-config/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.4.18 - _May 22, 2018_ + + * Dependencies updated + ## v0.4.17 - _May 4, 2018_ * Dependencies updated diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index aef14fead..8abc5bd99 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -11,7 +11,8 @@ "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", "pr": 579 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index edfd42269..68e5ed438 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.3 - _May 5, 2018_ +## v0.7.0 - _May 22, 2018_ + + * Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js (#579) + +## v0.6.3 - _May 4, 2018_ * Dependencies updated diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index 84b92b56c..2e2998bb3 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.3.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.3.1", diff --git a/packages/typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md index ad7622071..e12ce63f2 100644 --- a/packages/typescript-typings/CHANGELOG.md +++ b/packages/typescript-typings/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.3.1 - _May 5, 2018_ +## v0.3.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.3.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index f447bdd1c..616a17d62 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.6.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "0.7.0", "changes": [ diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 92e466b17..0c01bf4f1 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.1 - _May 5, 2018_ +## v0.6.2 - _May 22, 2018_ + + * Dependencies updated + +## v0.6.1 - _May 4, 2018_ * Dependencies updated diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 35e4383fd..b753ffbac 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1527009133, + "version": "0.6.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1525477860, "version": "0.6.3", diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index 3358c9a01..4b8fb7bac 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.6.3 - _May 5, 2018_ +## v0.6.4 - _May 22, 2018_ + + * Dependencies updated + +## v0.6.3 - _May 4, 2018_ * Dependencies updated -- cgit v1.2.3 From fa4e694859730fdb45a4b9bbc000278b2f081d9c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:26:39 -0700 Subject: Updated CHANGELOGS --- packages/sol-cov/CHANGELOG.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index f49e36525..0d3303231 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -1,5 +1,6 @@ [ { + "timestamp": 1527009134, "version": "0.1.0", "changes": [ { -- cgit v1.2.3 From 84a1b5612de3b22bbe6b8b01a997234771d98005 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:26:47 -0700 Subject: Publish - 0x.js@0.38.0 - @0xproject/abi-gen@0.3.0 - @0xproject/assert@0.2.10 - @0xproject/base-contract@0.3.2 - @0xproject/connect@0.6.13 - @0xproject/contract-wrappers@0.0.2 - contracts@2.1.29 - @0xproject/dev-utils@0.4.2 - @0xproject/fill-scenarios@0.0.2 - @0xproject/json-schemas@0.7.24 - @0xproject/metacoin@0.0.7 - @0xproject/migrations@0.0.6 - @0xproject/monorepo-scripts@0.1.20 - @0xproject/order-utils@0.0.5 - @0xproject/order-watcher@0.0.2 - @0xproject/react-docs-example@0.0.12 - @0xproject/react-docs@0.0.12 - @0xproject/react-shared@0.1.7 - @0xproject/sol-compiler@0.5.0 - @0xproject/sol-cov@0.0.11 - @0xproject/sol-resolver@0.0.5 - @0xproject/sra-report@0.1.0 - @0xproject/subproviders@0.10.2 - @0xproject/testnet-faucets@1.0.30 - @0xproject/tslint-config@0.4.18 - @0xproject/types@0.7.0 - @0xproject/typescript-typings@0.3.2 - @0xproject/utils@0.6.2 - @0xproject/web3-wrapper@0.6.4 - @0xproject/website@0.0.33 --- packages/0x.js/package.json | 34 ++++++++++++++++---------------- packages/abi-gen/package.json | 12 +++++------ packages/assert/package.json | 12 +++++------ packages/base-contract/package.json | 14 ++++++------- packages/connect/package.json | 16 +++++++-------- packages/contract-wrappers/package.json | 34 ++++++++++++++++---------------- packages/contracts/package.json | 22 ++++++++++----------- packages/dev-utils/package.json | 14 ++++++------- packages/fill-scenarios/package.json | 22 ++++++++++----------- packages/json-schemas/package.json | 10 +++++----- packages/metacoin/package.json | 22 ++++++++++----------- packages/migrations/package.json | 20 +++++++++---------- packages/monorepo-scripts/package.json | 2 +- packages/order-utils/package.json | 20 +++++++++---------- packages/order-watcher/package.json | 34 ++++++++++++++++---------------- packages/react-docs-example/package.json | 6 +++--- packages/react-docs/package.json | 12 +++++------ packages/react-shared/package.json | 8 ++++---- packages/sol-compiler/package.json | 20 +++++++++---------- packages/sol-cov/package.json | 15 +++++++------- packages/sol-resolver/package.json | 8 ++++---- packages/sra-report/package.json | 18 ++++++++--------- packages/subproviders/package.json | 16 +++++++-------- packages/testnet-faucets/package.json | 14 ++++++------- packages/tslint-config/package.json | 4 ++-- packages/types/package.json | 6 +++--- packages/typescript-typings/package.json | 6 +++--- packages/utils/package.json | 10 +++++----- packages/web3-wrapper/package.json | 12 +++++------ packages/website/package.json | 16 +++++++-------- 30 files changed, 229 insertions(+), 230 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 2fff1c058..6eff2fd9b 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -1,6 +1,6 @@ { "name": "0x.js", - "version": "0.37.2", + "version": "0.38.0", "engines": { "node": ">=6.12" }, @@ -68,12 +68,12 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/migrations": "^0.0.5", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/migrations": "^0.0.6", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -100,16 +100,16 @@ "webpack": "^3.1.0" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/contract-wrappers": "^0.0.1", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/order-watcher": "^0.0.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/contract-wrappers": "^0.0.2", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/order-watcher": "^0.0.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index ca666dc9b..d3af33fdf 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.2.13", + "version": "0.3.0", "engines": { "node": ">=6.12" }, @@ -27,9 +27,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -39,8 +39,8 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", diff --git a/packages/assert/package.json b/packages/assert/package.json index e3ac0d3ed..88f4dac99 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/assert", - "version": "0.2.9", + "version": "0.2.10", "engines": { "node": ">=6.12" }, @@ -30,8 +30,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -47,9 +47,9 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "lodash": "^4.17.4", "valid-url": "^1.0.9" }, diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index ca59dc4c8..f79d3ebf6 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/base-contract", - "version": "0.3.1", + "version": "0.3.2", "engines": { "node": ">=6.12" }, @@ -29,8 +29,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "chai": "^4.0.1", "copyfiles": "^1.2.0", @@ -42,10 +42,10 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/connect/package.json b/packages/connect/package.json index 65aa50a42..ed54b47ac 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "0.6.12", + "version": "0.6.13", "engines": { "node": ">=6.12" }, @@ -50,19 +50,19 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/assert": "^0.2.10", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", "query-string": "^5.0.1", "websocket": "^1.0.25" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/fetch-mock": "^5.12.1", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 6cb16c2c0..9dd6f097d 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/contract-wrappers", - "version": "0.0.1", + "version": "0.0.2", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -44,13 +44,13 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/migrations": "^0.0.5", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/migrations": "^0.0.6", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -76,15 +76,15 @@ "web3-provider-engine": "^14.0.4" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/fill-scenarios": "^0.0.1", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/fill-scenarios": "^0.0.2", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", "ethers": "^3.0.15", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index f17c64a6f..0147aac0b 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "contracts", - "version": "2.1.28", + "version": "2.1.29", "engines": { "node": ">=6.12" }, @@ -42,11 +42,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/tslint-config": "^0.4.18", "@0xproject/subproviders": "^0.10.1", "@0xproject/sol-cov": "^0.0.10", - "@0xproject/tslint-config": "^0.4.17", "@types/lodash": "4.14.104", "@types/node": "^8.0.53", "@types/yargs": "^10.0.0", @@ -66,13 +66,13 @@ "yargs": "^10.0.3" }, "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "0x.js": "^0.38.0", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^5.1.1", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 9dd3750c5..0b11029f6 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/dev-utils", - "version": "0.4.1", + "version": "0.4.2", "engines": { "node": ">=6.12" }, @@ -29,8 +29,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", @@ -44,10 +44,10 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/subproviders": "^0.10.1", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/web3-wrapper": "^0.6.4", "lodash": "^4.17.4", "web3": "^0.20.0", "web3-provider-engine": "^14.0.4" diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json index ee426c7a1..0d8ea6d13 100644 --- a/packages/fill-scenarios/package.json +++ b/packages/fill-scenarios/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/fill-scenarios", - "version": "0.0.1", + "version": "0.0.2", "description": "0x order fill scenario generator", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -23,10 +23,10 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -36,12 +36,12 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/base-contract": "^0.3.1", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index aece885ec..1612bbc0a 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/json-schemas", - "version": "0.7.23", + "version": "0.7.24", "engines": { "node": ">=6.12" }, @@ -45,15 +45,15 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { - "@0xproject/typescript-typings": "^0.3.1", + "@0xproject/typescript-typings": "^0.3.2", "@types/node": "^8.0.53", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/utils": "^0.6.1", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/utils": "^0.6.2", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 83d083b3f..312aa0819 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/metacoin", - "version": "0.0.6", + "version": "0.0.7", "engines": { "node": ">=6.12" }, @@ -26,21 +26,21 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/sol-cov": "^0.0.10", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/types": "^0.6.3", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/sol-cov": "^0.0.11", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/types": "^0.7.0", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4", "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", + "@0xproject/dev-utils": "^0.4.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^2.0.1", diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 61dfc5de6..08f7aa6b2 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/migrations", - "version": "0.0.5", + "version": "0.0.6", "engines": { "node": ">=6.12" }, @@ -25,10 +25,10 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/types": "^0.6.3", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/types": "^0.7.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", @@ -36,11 +36,11 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4" }, diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index 4fa9497b9..02a8e4a42 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/monorepo-scripts", - "version": "0.1.19", + "version": "0.1.20", "engines": { "node": ">=6.12" }, diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 63caaec34..117b57f45 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-utils", - "version": "0.0.4", + "version": "0.0.5", "engines": { "node": ">=6.12" }, @@ -43,9 +43,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -62,12 +62,12 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "@types/node": "^8.0.53", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index d65d3f175..2bd7e4dcb 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-watcher", - "version": "0.0.1", + "version": "0.0.2", "description": "An order watcher daemon that watches for order validity", "keywords": [ "0x", @@ -45,12 +45,12 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/migrations": "^0.0.5", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/migrations": "^0.0.6", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/tslint-config": "^0.4.18", "@types/bintrees": "^1.0.2", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -76,16 +76,16 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/contract-wrappers": "^0.0.1", - "@0xproject/fill-scenarios": "^0.0.1", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/order-utils": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/assert": "^0.2.10", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/contract-wrappers": "^0.0.2", + "@0xproject/fill-scenarios": "^0.0.2", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/order-utils": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "bintrees": "^1.0.2", "ethers": "^3.0.15", "lodash": "^4.17.4" diff --git a/packages/react-docs-example/package.json b/packages/react-docs-example/package.json index 2cbf3ef73..a0538b933 100644 --- a/packages/react-docs-example/package.json +++ b/packages/react-docs-example/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0xproject/react-docs-example", - "version": "0.0.11", + "version": "0.0.12", "engines": { "node": ">=6.12" }, @@ -26,7 +26,7 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", @@ -50,7 +50,7 @@ "webpack-dev-server": "^2.11.1" }, "dependencies": { - "@0xproject/react-docs": "^0.0.11", + "@0xproject/react-docs": "^0.0.12", "basscss": "^8.0.3", "lodash": "^4.17.4", "material-ui": "^0.17.1", diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index 9245cfb1e..531c0d90c 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-docs", - "version": "0.0.11", + "version": "0.0.12", "engines": { "node": ">=6.12" }, @@ -25,9 +25,9 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -35,8 +35,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/react-shared": "^0.1.6", - "@0xproject/utils": "^0.6.1", + "@0xproject/react-shared": "^0.1.7", + "@0xproject/utils": "^0.6.2", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index af0920d27..d28972325 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-shared", - "version": "0.1.6", + "version": "0.1.7", "engines": { "node": ">=6.12" }, @@ -25,9 +25,9 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 31a10f8b7..c94e59eb4 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-compiler", - "version": "0.4.3", + "version": "0.5.0", "engines": { "node": ">=6.12" }, @@ -49,9 +49,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/mkdirp": "^0.5.2", "@types/require-from-string": "^1.2.0", "@types/semver": "^5.5.0", @@ -72,12 +72,12 @@ "zeppelin-solidity": "1.8.0" }, "dependencies": { - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/sol-resolver": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/sol-resolver": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "@types/yargs": "^11.0.0", "chalk": "^2.3.0", "ethereumjs-util": "^5.1.1", diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 593ff8356..e4d8c6da8 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-cov", - "version": "0.0.10", + "version": "0.0.11", "engines": { "node": ">=6.12" }, @@ -46,12 +46,11 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { - "@0xproject/subproviders": "^0.10.1", - "@0xproject/types": "^0.6.3", - "@0xproject/utils": "^0.6.1", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", "ethereumjs-util": "^5.1.1", "rimraf": "^2.6.2", "glob": "^7.1.2", @@ -62,8 +61,8 @@ "solidity-parser-antlr": "^0.2.8" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/istanbul": "^0.4.30", "@types/rimraf": "^2.0.2", "@types/mkdirp": "^0.5.1", diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index 54d8308de..64a0f19ab 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-resolver", - "version": "0.0.4", + "version": "0.0.5", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -33,7 +33,7 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", + "@0xproject/types": "^0.7.0", "@0xproject/typescript-typings": "^0.0.3", "lodash": "^4.17.4" }, diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 9622acd2e..0ab83f5f7 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sra-report", - "version": "0.0.14", + "version": "0.1.0", "engines": { "node": ">=6.12" }, @@ -31,20 +31,20 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-report/README.md", "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/assert": "^0.2.9", - "@0xproject/connect": "^0.6.12", - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "0x.js": "^0.38.0", + "@0xproject/assert": "^0.2.10", + "@0xproject/connect": "^0.6.13", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "chalk": "^2.3.0", "lodash": "^4.17.4", "newman": "^3.9.3", "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.48", "@types/nock": "^9.1.2", diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 21e47b85a..3cd5f0e9b 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/subproviders", - "version": "0.10.1", + "version": "0.10.2", "engines": { "node": ">=6.12" }, @@ -39,10 +39,10 @@ } }, "dependencies": { - "@0xproject/assert": "^0.2.9", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/assert": "^0.2.10", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "@ledgerhq/hw-app-eth": "^4.3.0", "@ledgerhq/hw-transport-u2f": "^4.3.0", "bip39": "^2.5.0", @@ -57,9 +57,9 @@ "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/utils": "^0.6.1", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/utils": "^0.6.2", "@types/bip39": "^2.4.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index db5fe75c7..c565d5b7d 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0xproject/testnet-faucets", - "version": "1.0.29", + "version": "1.0.30", "engines": { "node": ">=6.12" }, @@ -18,11 +18,11 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "0x.js": "^0.38.0", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "body-parser": "^1.17.1", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", @@ -33,7 +33,7 @@ "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/tslint-config": "^0.4.18", "@types/body-parser": "^1.16.1", "@types/express": "^4.0.35", "@types/lodash": "4.14.104", diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 799f716f3..a64feb836 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/tslint-config", - "version": "0.4.17", + "version": "0.4.18", "engines": { "node": ">=6.12" }, @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/tslint-config/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", + "@0xproject/monorepo-scripts": "^0.1.20", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", diff --git a/packages/types/package.json b/packages/types/package.json index edd17c42c..0968c6b7a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/types", - "version": "0.6.3", + "version": "0.7.0", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index 986acfcee..932f89ec5 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/typescript-typings", - "version": "0.3.1", + "version": "0.3.2", "engines": { "node": ">=6.12" }, @@ -25,11 +25,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", "dependencies": { - "@0xproject/types": "^0.6.3", + "@0xproject/types": "^0.7.0", "bignumber.js": "~4.1.0" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", + "@0xproject/monorepo-scripts": "^0.1.20", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2" diff --git a/packages/utils/package.json b/packages/utils/package.json index 66dc682fa..99d3d9256 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "0.6.1", + "version": "0.6.2", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -35,8 +35,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", "@types/node": "^8.0.53", "bignumber.js": "~4.1.0", "ethers": "^3.0.15", diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index ed2fce7dc..18bbf14a0 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/web3-wrapper", - "version": "0.6.3", + "version": "0.6.4", "engines": { "node": ">=6.12" }, @@ -43,8 +43,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -62,9 +62,9 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", "ethers": "^3.0.15", "lodash": "^4.17.4", "web3": "^0.20.0" diff --git a/packages/website/package.json b/packages/website/package.json index 8b34cd743..7d49581cd 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/website", - "version": "0.0.32", + "version": "0.0.33", "engines": { "node": ">=6.12" }, @@ -18,13 +18,13 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.37.2", - "@0xproject/react-docs": "^0.0.11", - "@0xproject/react-shared": "^0.1.6", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "0x.js": "^0.38.0", + "@0xproject/react-docs": "^0.0.12", + "@0xproject/react-shared": "^0.1.7", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "accounting": "^0.4.1", "basscss": "^8.0.3", "blockies": "^0.0.2", -- cgit v1.2.3 From ac52ad88a1884979c74f418398bbf428d727cf34 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:39:27 -0700 Subject: Use loglevel instead of verbose flag --- packages/sol-cov/package.json | 8 +++++--- packages/sol-cov/src/coverage_manager.ts | 18 +++++++----------- yarn.lock | 6 +++++- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index e4d8c6da8..0edffb1d2 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -46,17 +46,18 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { + "@0xproject/sol-compiler": "^0.4.3", "@0xproject/subproviders": "^0.10.2", "@0xproject/types": "^0.7.0", "@0xproject/typescript-typings": "^0.3.2", "@0xproject/utils": "^0.6.2", - "@0xproject/sol-compiler": "^0.4.3", "ethereumjs-util": "^5.1.1", - "rimraf": "^2.6.2", "glob": "^7.1.2", "istanbul": "^0.4.5", "lodash": "^4.17.4", + "loglevel": "^1.6.1", "mkdirp": "^0.5.1", + "rimraf": "^2.6.2", "semaphore-async-await": "^1.5.1", "solidity-parser-antlr": "^0.2.8" }, @@ -64,10 +65,11 @@ "@0xproject/monorepo-scripts": "^0.1.20", "@0xproject/tslint-config": "^0.4.18", "@types/istanbul": "^0.4.30", - "@types/rimraf": "^2.0.2", + "@types/loglevel": "^1.5.3", "@types/mkdirp": "^0.5.1", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", + "@types/rimraf": "^2.0.2", "chai": "^4.0.1", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index d7a00f86d..3aa62acff 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -3,6 +3,7 @@ import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import { Collector } from 'istanbul'; import * as _ from 'lodash'; +import { getLogger, levels, Logger, LogLevel } from 'loglevel'; import * as mkdirp from 'mkdirp'; import * as path from 'path'; @@ -35,7 +36,7 @@ const mkdirpAsync = promisify(mkdirp); export class CoverageManager { private _artifactAdapter: AbstractArtifactAdapter; - private _verbose: boolean; + private _logger: Logger; private _traceInfos: TraceInfo[] = []; private _getContractCodeAsync: (address: string) => Promise; private static _getSingleFileCoverageForTrace( @@ -124,7 +125,7 @@ export class CoverageManager { } private static _getContractDataIfExists(contractsData: ContractData[], bytecode: string): ContractData | undefined { if (!bytecode.startsWith('0x')) { - throw new Error(')x missing'); + throw new Error('0x missing'); } const contractData = _.find(contractsData, contractDataCandidate => { const bytecodeRegex = CoverageManager._bytecodeToBytecodeRegex(contractDataCandidate.bytecode); @@ -142,7 +143,8 @@ export class CoverageManager { ) { this._getContractCodeAsync = getContractCodeAsync; this._artifactAdapter = artifactAdapter; - this._verbose = verbose; + this._logger = getLogger('sol-cov'); + this._logger.setLevel(verbose ? levels.TRACE : levels.ERROR); } public appendTraceInfo(traceInfo: TraceInfo): void { this._traceInfos.push(traceInfo); @@ -162,10 +164,7 @@ export class CoverageManager { const runtimeBytecode = (traceInfo as TraceInfoExistingContract).runtimeBytecode; const contractData = CoverageManager._getContractDataIfExists(contractsData, runtimeBytecode); if (_.isUndefined(contractData)) { - if (this._verbose) { - // tslint:disable-next-line:no-console - console.warn(`Transaction to an unknown address: ${traceInfo.address}`); - } + this._logger.warn(`Transaction to an unknown address: ${traceInfo.address}`); continue; } const bytecodeHex = stripHexPrefix(runtimeBytecode); @@ -190,10 +189,7 @@ export class CoverageManager { const bytecode = (traceInfo as TraceInfoNewContract).bytecode; const contractData = CoverageManager._getContractDataIfExists(contractsData, bytecode); if (_.isUndefined(contractData)) { - if (this._verbose) { - // tslint:disable-next-line:no-console - console.warn(`Unknown contract creation transaction`); - } + this._logger.warn(`Unknown contract creation transaction`); continue; } const bytecodeHex = stripHexPrefix(bytecode); diff --git a/yarn.lock b/yarn.lock index 98215f54b..42c4fa025 100644 --- a/yarn.lock +++ b/yarn.lock @@ -184,6 +184,10 @@ version "4.14.99" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.99.tgz#e6e10c0a4cc16c7409b3181f1e66880d2fb7d4dc" +"@types/loglevel@^1.5.3": + version "1.5.3" + resolved "https://registry.yarnpkg.com/@types/loglevel/-/loglevel-1.5.3.tgz#adfce55383edc5998a2170ad581b3e23d6adb5b8" + "@types/marked@0.0.28": version "0.0.28" resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.0.28.tgz#44ba754e9fa51432583e8eb30a7c4dd249b52faa" @@ -7081,7 +7085,7 @@ log-update@^1.0.2: ansi-escapes "^1.0.0" cli-cursor "^1.0.2" -loglevel@^1.4.1: +loglevel@^1.4.1, loglevel@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" -- cgit v1.2.3 From 83c37c6a7a320326975c8afd9d49a42c9afcefd4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 11:05:24 -0700 Subject: Address feedback --- packages/sol-cov/src/coverage_manager.ts | 4 +-- packages/sol-cov/src/trace.ts | 27 ++++++------------- .../sol-cov/test/collect_contracts_data_test.ts | 30 ---------------------- .../test/sol_compiler_artifact_adapter_test.ts | 30 ++++++++++++++++++++++ packages/sol-resolver/CHANGELOG.json | 4 +-- .../subproviders/src/utils/subprovider_utils.ts | 2 ++ packages/utils/package.json | 1 + packages/utils/src/abi_decoder.ts | 13 ++-------- packages/utils/src/address_utils.ts | 5 ++++ 9 files changed, 52 insertions(+), 64 deletions(-) delete mode 100644 packages/sol-cov/test/collect_contracts_data_test.ts create mode 100644 packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index 3aa62acff..ef893527a 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -139,12 +139,12 @@ export class CoverageManager { constructor( artifactAdapter: AbstractArtifactAdapter, getContractCodeAsync: (address: string) => Promise, - verbose: boolean, + isVerbose: boolean, ) { this._getContractCodeAsync = getContractCodeAsync; this._artifactAdapter = artifactAdapter; this._logger = getLogger('sol-cov'); - this._logger.setLevel(verbose ? levels.TRACE : levels.ERROR); + this._logger.setLevel(isVerbose ? levels.TRACE : levels.ERROR); } public appendTraceInfo(traceInfo: TraceInfo): void { this._traceInfos.push(traceInfo); diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 30508898b..81c8bb0ff 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -1,5 +1,5 @@ import { OpCode, StructLog, TransactionTrace } from '@0xproject/types'; -import { BigNumber, logUtils } from '@0xproject/utils'; +import { addressUtils, BigNumber, logUtils } from '@0xproject/utils'; import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -7,17 +7,13 @@ import * as _ from 'lodash'; export interface TraceByContractAddress { [contractAddress: string]: StructLog[]; } -function padZeros(address: string): string { - return addHexPrefix(_.padStart(stripHexPrefix(address), 40, '0')); -} export function getTracesByContractAddress(structLogs: StructLog[], startAddress: string): TraceByContractAddress { const traceByContractAddress: TraceByContractAddress = {}; let currentTraceSegment = []; const callStack = [startAddress]; - // tslint:disable-next-line: prefer-for-of - for (let i = 0; i < structLogs.length; ++i) { - const structLog = structLogs[i]; + // tslint:disable-next-line:prefer-for-of + for (const structLog of structLogs) { if (structLog.depth !== callStack.length - 1) { throw new Error("Malformed trace. trace depth doesn't match call stack depth"); } @@ -26,26 +22,19 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress // That means that we can always safely pop from it currentTraceSegment.push(structLog); - if ( - structLog.op === OpCode.CallCode || - structLog.op === OpCode.StaticCall || - structLog.op === OpCode.Call || - structLog.op === OpCode.DelegateCall - ) { + if (_.includes([OpCode.CallCode, OpCode.StaticCall, OpCode.Call, OpCode.DelegateCall], structLog.op)) { const currentAddress = _.last(callStack) as string; const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2; - const newAddress = padZeros(new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16)); + const newAddress = addressUtils.padZeros( + new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16), + ); callStack.push(newAddress); traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( currentTraceSegment, ); currentTraceSegment = []; } else if ( - structLog.op === OpCode.Return || - structLog.op === OpCode.Stop || - structLog.op === OpCode.Revert || - structLog.op === OpCode.Invalid || - structLog.op === OpCode.SelfDestruct + _.includes([OpCode.Return, OpCode.Stop, OpCode.Revert, OpCode.Invalid, OpCode.SelfDestruct], structLog.op) ) { const currentAddress = callStack.pop() as string; traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( diff --git a/packages/sol-cov/test/collect_contracts_data_test.ts b/packages/sol-cov/test/collect_contracts_data_test.ts deleted file mode 100644 index d423bc603..000000000 --- a/packages/sol-cov/test/collect_contracts_data_test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as chai from 'chai'; -import * as _ from 'lodash'; -import 'make-promises-safe'; -import 'mocha'; -import * as path from 'path'; - -import { SolCompilerArtifactAdapter } from '../src/artifact_adapters/sol_compiler_artifact_adapter'; - -const expect = chai.expect; - -describe('Collect contracts data', () => { - describe('#collectContractsData', () => { - it('correctly collects contracts data', async () => { - const artifactsPath = path.resolve(__dirname, 'fixtures/artifacts'); - const sourcesPath = path.resolve(__dirname, 'fixtures/contracts'); - const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(artifactsPath, sourcesPath); - const contractsData = await zeroExArtifactsAdapter.collectContractsDataAsync(); - _.forEach(contractsData, contractData => { - expect(contractData).to.have.keys([ - 'sourceCodes', - 'sources', - 'sourceMap', - 'sourceMapRuntime', - 'bytecode', - 'runtimeBytecode', - ]); - }); - }); - }); -}); diff --git a/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts b/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts new file mode 100644 index 000000000..0ebad669b --- /dev/null +++ b/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts @@ -0,0 +1,30 @@ +import * as chai from 'chai'; +import * as _ from 'lodash'; +import 'make-promises-safe'; +import 'mocha'; +import * as path from 'path'; + +import { SolCompilerArtifactAdapter } from '../src/artifact_adapters/sol_compiler_artifact_adapter'; + +const expect = chai.expect; + +describe('SolCompilerArtifactAdapter', () => { + describe('#collectContractsData', () => { + it('correctly collects contracts data', async () => { + const artifactsPath = path.resolve(__dirname, 'fixtures/artifacts'); + const sourcesPath = path.resolve(__dirname, 'fixtures/contracts'); + const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(artifactsPath, sourcesPath); + const contractsData = await zeroExArtifactsAdapter.collectContractsDataAsync(); + _.forEach(contractsData, contractData => { + expect(contractData).to.have.keys([ + 'sourceCodes', + 'sources', + 'sourceMap', + 'sourceMapRuntime', + 'bytecode', + 'runtimeBytecode', + ]); + }); + }); + }); +}); diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index 6d5917212..895bd2104 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -3,11 +3,11 @@ "version": "0.0.5", "changes": [ { - "note": "Fix a bug in FsResolver trying to read directories as files", + "note": "Fix a bug in FsResolver where it tries to read directories as files", "pr": 589 }, { - "note": "Fix a bug in NameResolver not ignoring .sol files", + "note": "Fix a bug in NameResolver where it is not ignoring .sol files", "pr": 589 } ] diff --git a/packages/subproviders/src/utils/subprovider_utils.ts b/packages/subproviders/src/utils/subprovider_utils.ts index 380f98606..24ebedd06 100644 --- a/packages/subproviders/src/utils/subprovider_utils.ts +++ b/packages/subproviders/src/utils/subprovider_utils.ts @@ -9,5 +9,7 @@ import { Subprovider } from '../subproviders/subprovider'; */ export function prependSubprovider(provider: ProviderEngine, subprovider: Subprovider): void { subprovider.setEngine(provider); + // HACK: We use implementation details of provider engine here + // https://github.com/MetaMask/provider-engine/blob/master/index.js#L68 (provider as any)._providers = [subprovider, ...(provider as any)._providers]; } diff --git a/packages/utils/package.json b/packages/utils/package.json index 99d3d9256..24551dd93 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -38,6 +38,7 @@ "@0xproject/types": "^0.7.0", "@0xproject/typescript-typings": "^0.3.2", "@types/node": "^8.0.53", + "ethereumjs-util": "^5.1.1", "bignumber.js": "~4.1.0", "ethers": "^3.0.15", "js-sha3": "^0.7.0", diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index c78bfa343..d2d8364ca 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -12,21 +12,12 @@ import { import * as ethers from 'ethers'; import * as _ from 'lodash'; +import { addressUtils } from './address_utils'; import { BigNumber } from './configured_bignumber'; export class AbiDecoder { private _savedABIs: AbiDefinition[] = []; private _methodIds: { [signatureHash: string]: EventAbi } = {}; - private static _padZeros(address: string): string { - let formatted = address; - if (_.startsWith(formatted, '0x')) { - formatted = formatted.slice(2); - } - - const addressLength = 40; - formatted = _.padStart(formatted, addressLength, '0'); - return `0x${formatted}`; - } constructor(abiArrays: AbiDefinition[][]) { _.forEach(abiArrays, this.addABI.bind(this)); } @@ -56,7 +47,7 @@ export class AbiDecoder { } if (param.type === SolidityTypes.Address) { const baseHex = 16; - value = AbiDecoder._padZeros(new BigNumber(value).toString(baseHex)); + value = addressUtils.padZeros(new BigNumber(value).toString(baseHex)); } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) { value = new BigNumber(value); } else if (param.type === SolidityTypes.Uint8) { diff --git a/packages/utils/src/address_utils.ts b/packages/utils/src/address_utils.ts index e25bde249..cc43bd477 100644 --- a/packages/utils/src/address_utils.ts +++ b/packages/utils/src/address_utils.ts @@ -1,4 +1,6 @@ +import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; import * as jsSHA3 from 'js-sha3'; +import * as _ from 'lodash'; const BASIC_ADDRESS_REGEX = /^(0x)?[0-9a-f]{40}$/i; const SAME_CASE_ADDRESS_REGEX = /^(0x)?([0-9a-f]{40}|[0-9A-F]{40})$/; @@ -38,4 +40,7 @@ export const addressUtils = { return isValidChecksummedAddress; } }, + padZeros(address: string): string { + return addHexPrefix(_.padStart(stripHexPrefix(address), 40, '0')); + }, }; -- cgit v1.2.3 From 0c53d276f8f4725feeae48fc3534ab63db8fcafb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 11:10:03 -0700 Subject: Use BlockParamLiteral.Latest --- packages/sol-cov/src/coverage_subprovider.ts | 8 ++++---- packages/sol-cov/src/types.ts | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index 1e050080f..3fd45bbd1 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -8,7 +8,7 @@ import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_a import { constants } from './constants'; import { CoverageManager } from './coverage_manager'; import { getTracesByContractAddress } from './trace'; -import { TraceInfoExistingContract, TraceInfoNewContract } from './types'; +import { BlockParamLiteral, TraceInfoExistingContract, TraceInfoNewContract } from './types'; interface MaybeFakeTxData extends TxData { isFakeTransaction?: boolean; @@ -89,7 +89,7 @@ export class CoverageSubprovider extends Subprovider { } else { const payload = { method: 'eth_getBlockByNumber', - params: ['latest', true], + params: [BlockParamLiteral.Latest, true], }; const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); const transactions = jsonRPCResponsePayload.result.transactions; @@ -136,7 +136,7 @@ export class CoverageSubprovider extends Subprovider { } else { const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); for (const subcallAddress of _.keys(tracesByContractAddress)) { - payload = { method: 'eth_getCode', params: [subcallAddress, 'latest'] }; + payload = { method: 'eth_getCode', params: [subcallAddress, BlockParamLiteral.Latest] }; const runtimeBytecode = (await this.emitPayloadAsync(payload)).result; const traceForThatSubcall = tracesByContractAddress[subcallAddress]; const coveredPcs = _.map(traceForThatSubcall, log => log.pc); @@ -178,7 +178,7 @@ export class CoverageSubprovider extends Subprovider { private async _getContractCodeAsync(address: string): Promise { const payload = { method: 'eth_getCode', - params: [address, 'latest'], + params: [address, BlockParamLiteral.Latest], }; const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); const contractCode: string = jsonRPCResponsePayload.result; diff --git a/packages/sol-cov/src/types.ts b/packages/sol-cov/src/types.ts index 01359d858..4c3de55a1 100644 --- a/packages/sol-cov/src/types.ts +++ b/packages/sol-cov/src/types.ts @@ -98,3 +98,7 @@ export interface TraceInfoExistingContract extends TraceInfoBase { } export type TraceInfo = TraceInfoNewContract | TraceInfoExistingContract; + +export enum BlockParamLiteral { + Latest = 'latest', +} -- cgit v1.2.3 From 447b305e3c50145696be715bc6f43523b0770220 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 11:18:09 -0700 Subject: Suppport subcalls in constructor --- packages/0x.js/test/artifacts_test.ts | 4 ++-- packages/sol-cov/src/coverage_subprovider.ts | 36 ++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/packages/0x.js/test/artifacts_test.ts b/packages/0x.js/test/artifacts_test.ts index ca554a4f5..982fb8e63 100644 --- a/packages/0x.js/test/artifacts_test.ts +++ b/packages/0x.js/test/artifacts_test.ts @@ -15,7 +15,7 @@ const TIMEOUT = 10000; describe('Artifacts', () => { describe('contracts are deployed on kovan', () => { const kovanRpcUrl = constants.KOVAN_RPC_URL; - const provider = web3Factory.create({ rpcUrl: kovanRpcUrl }).currentProvider; + const provider = web3Factory.getRpcProvider({ rpcUrl: kovanRpcUrl }); const config = { networkId: constants.KOVAN_NETWORK_ID, }; @@ -32,7 +32,7 @@ describe('Artifacts', () => { }); describe('contracts are deployed on ropsten', () => { const ropstenRpcUrl = constants.ROPSTEN_RPC_URL; - const provider = web3Factory.create({ rpcUrl: ropstenRpcUrl }).currentProvider; + const provider = web3Factory.getRpcProvider({ rpcUrl: ropstenRpcUrl }); const config = { networkId: constants.ROPSTEN_NETWORK_ID, }; diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index 3fd45bbd1..45b479c0e 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -123,16 +123,32 @@ export class CoverageSubprovider extends Subprovider { const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); const trace: TransactionTrace = jsonRPCResponsePayload.result; if (address === constants.NEW_CONTRACT) { - // TODO handle calls to external contracts and contract creations from within the constructor - const structLogsOnDepth0 = _.filter(trace.structLogs, { depth: 0 }); - const coveredPcs = _.map(structLogsOnDepth0, log => log.pc); - const traceInfo: TraceInfoNewContract = { - coveredPcs, - txHash, - address: address as 'NEW_CONTRACT', - bytecode: data as string, - }; - this._coverageManager.appendTraceInfo(traceInfo); + const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); + for (const subcallAddress of _.keys(tracesByContractAddress)) { + let traceInfo: TraceInfoNewContract | TraceInfoExistingContract; + if (subcallAddress === 'NEW_CONTRACT') { + const traceForThatSubcall = tracesByContractAddress[subcallAddress]; + const coveredPcs = _.map(traceForThatSubcall, log => log.pc); + traceInfo = { + coveredPcs, + txHash, + address: address as 'NEW_CONTRACT', + bytecode: data as string, + }; + } else { + payload = { method: 'eth_getCode', params: [subcallAddress, BlockParamLiteral.Latest] }; + const runtimeBytecode = (await this.emitPayloadAsync(payload)).result; + const traceForThatSubcall = tracesByContractAddress[subcallAddress]; + const coveredPcs = _.map(traceForThatSubcall, log => log.pc); + traceInfo = { + coveredPcs, + txHash, + address: subcallAddress, + runtimeBytecode, + }; + } + this._coverageManager.appendTraceInfo(traceInfo); + } } else { const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); for (const subcallAddress of _.keys(tracesByContractAddress)) { -- cgit v1.2.3 From 6540343f456004549077f708f0d43533488fb4e4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 13:20:58 -0700 Subject: Remove trace.json --- packages/sol-cov/src/trace.json | 3227 --------------------------------------- 1 file changed, 3227 deletions(-) delete mode 100644 packages/sol-cov/src/trace.json diff --git a/packages/sol-cov/src/trace.json b/packages/sol-cov/src/trace.json deleted file mode 100644 index 77ec20a72..000000000 --- a/packages/sol-cov/src/trace.json +++ /dev/null @@ -1,3227 +0,0 @@ -[ - { - "depth": 0, - "error": "", - "gas": 21216, - "gasCost": 21784, - "memory": null, - "op": "PUSH1", - "pc": 0, - "stack": [], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21213, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2, - "stack": ["0000000000000000000000000000000000000000000000000000000000000080"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21210, - "gasCost": 3, - "memory": null, - "op": "MSTORE", - "pc": 4, - "stack": [ - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21198, - "gasCost": 12, - "memory": null, - "op": "PUSH1", - "pc": 5, - "stack": [], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21195, - "gasCost": 3, - "memory": null, - "op": "CALLDATASIZE", - "pc": 7, - "stack": ["0000000000000000000000000000000000000000000000000000000000000004"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21193, - "gasCost": 2, - "memory": null, - "op": "LT", - "pc": 8, - "stack": [ - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21190, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 9, - "stack": ["0000000000000000000000000000000000000000000000000000000000000000"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21187, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 12, - "stack": [ - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000af" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21177, - "gasCost": 10, - "memory": null, - "op": "PUSH1", - "pc": 13, - "stack": [], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21174, - "gasCost": 3, - "memory": null, - "op": "CALLDATALOAD", - "pc": 15, - "stack": ["0000000000000000000000000000000000000000000000000000000000000000"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21171, - "gasCost": 3, - "memory": null, - "op": "PUSH29", - "pc": 16, - "stack": ["2e1a7d4d0000000000000000000000000000000000000000000000000de0b6b3"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21168, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 46, - "stack": [ - "2e1a7d4d0000000000000000000000000000000000000000000000000de0b6b3", - "0000000100000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21165, - "gasCost": 3, - "memory": null, - "op": "DIV", - "pc": 47, - "stack": [ - "0000000100000000000000000000000000000000000000000000000000000000", - "2e1a7d4d0000000000000000000000000000000000000000000000000de0b6b3" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21160, - "gasCost": 5, - "memory": null, - "op": "PUSH4", - "pc": 48, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21157, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 53, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "00000000000000000000000000000000000000000000000000000000ffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21154, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 54, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21151, - "gasCost": 3, - "memory": null, - "op": "PUSH4", - "pc": 55, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21148, - "gasCost": 3, - "memory": null, - "op": "EQ", - "pc": 60, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000006fdde03" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21145, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 61, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21142, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 64, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000b9" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21132, - "gasCost": 10, - "memory": null, - "op": "DUP1", - "pc": 65, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21129, - "gasCost": 3, - "memory": null, - "op": "PUSH4", - "pc": 66, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21126, - "gasCost": 3, - "memory": null, - "op": "EQ", - "pc": 71, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "00000000000000000000000000000000000000000000000000000000095ea7b3" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21123, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 72, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21120, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 75, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000149" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21110, - "gasCost": 10, - "memory": null, - "op": "DUP1", - "pc": 76, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21107, - "gasCost": 3, - "memory": null, - "op": "PUSH4", - "pc": 77, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21104, - "gasCost": 3, - "memory": null, - "op": "EQ", - "pc": 82, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000018160ddd" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21101, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 83, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21098, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 86, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001ae" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21088, - "gasCost": 10, - "memory": null, - "op": "DUP1", - "pc": 87, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21085, - "gasCost": 3, - "memory": null, - "op": "PUSH4", - "pc": 88, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21082, - "gasCost": 3, - "memory": null, - "op": "EQ", - "pc": 93, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000023b872dd" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21079, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 94, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21076, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 97, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001d9" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21066, - "gasCost": 10, - "memory": null, - "op": "DUP1", - "pc": 98, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21063, - "gasCost": 3, - "memory": null, - "op": "PUSH4", - "pc": 99, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21060, - "gasCost": 3, - "memory": null, - "op": "EQ", - "pc": 104, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "000000000000000000000000000000000000000000000000000000002e1a7d4d" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21057, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 105, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21054, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 108, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000001", - "000000000000000000000000000000000000000000000000000000000000025e" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21044, - "gasCost": 10, - "memory": null, - "op": "JUMPDEST", - "pc": 606, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21043, - "gasCost": 1, - "memory": null, - "op": "CALLVALUE", - "pc": 607, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21041, - "gasCost": 2, - "memory": null, - "op": "DUP1", - "pc": 608, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21038, - "gasCost": 3, - "memory": null, - "op": "ISZERO", - "pc": 609, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21035, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 610, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21032, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 613, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "000000000000000000000000000000000000000000000000000000000000026a" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21022, - "gasCost": 10, - "memory": null, - "op": "JUMPDEST", - "pc": 618, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21021, - "gasCost": 1, - "memory": null, - "op": "POP", - "pc": 619, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21019, - "gasCost": 2, - "memory": null, - "op": "PUSH2", - "pc": 620, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21016, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 623, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21013, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 625, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21010, - "gasCost": 3, - "memory": null, - "op": "CALLDATASIZE", - "pc": 626, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21008, - "gasCost": 2, - "memory": null, - "op": "SUB", - "pc": 627, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21005, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 628, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 21002, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 629, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20999, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 630, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20996, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 631, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20993, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 632, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20990, - "gasCost": 3, - "memory": null, - "op": "CALLDATALOAD", - "pc": 633, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20987, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 634, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20984, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 635, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20981, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 637, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20978, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 638, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20975, - "gasCost": 3, - "memory": null, - "op": "SWAP3", - "pc": 639, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20972, - "gasCost": 3, - "memory": null, - "op": "SWAP2", - "pc": 640, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20969, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 641, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20966, - "gasCost": 3, - "memory": null, - "op": "POP", - "pc": 642, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20964, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 643, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000024", - "0000000000000000000000000000000000000000000000000000000000000004" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20962, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 644, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000024" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20960, - "gasCost": 2, - "memory": null, - "op": "PUSH2", - "pc": 645, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20957, - "gasCost": 3, - "memory": null, - "op": "JUMP", - "pc": 648, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000a22" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20949, - "gasCost": 8, - "memory": null, - "op": "JUMPDEST", - "pc": 2594, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20948, - "gasCost": 1, - "memory": null, - "op": "DUP1", - "pc": 2595, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20945, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2596, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20942, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2598, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20939, - "gasCost": 3, - "memory": null, - "op": "CALLER", - "pc": 2600, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20937, - "gasCost": 2, - "memory": null, - "op": "PUSH20", - "pc": 2601, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20934, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 2622, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20931, - "gasCost": 3, - "memory": null, - "op": "PUSH20", - "pc": 2623, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20928, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 2644, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20925, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2645, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20922, - "gasCost": 3, - "memory": null, - "op": "MSTORE", - "pc": 2646, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20919, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2647, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20916, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 2649, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20913, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 2650, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20910, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2651, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000003" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20907, - "gasCost": 3, - "memory": null, - "op": "MSTORE", - "pc": 2652, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20904, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2653, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20901, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 2655, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20898, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2656, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20895, - "gasCost": 3, - "memory": null, - "op": "SHA3", - "pc": 2658, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000040", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20853, - "gasCost": 42, - "memory": null, - "op": "SLOAD", - "pc": 2659, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20653, - "gasCost": 200, - "memory": null, - "op": "LT", - "pc": 2660, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20650, - "gasCost": 3, - "memory": null, - "op": "ISZERO", - "pc": 2661, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20647, - "gasCost": 3, - "memory": null, - "op": "ISZERO", - "pc": 2662, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20644, - "gasCost": 3, - "memory": null, - "op": "ISZERO", - "pc": 2663, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20641, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 2664, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20638, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 2667, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000a70" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20628, - "gasCost": 10, - "memory": null, - "op": "JUMPDEST", - "pc": 2672, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20627, - "gasCost": 1, - "memory": null, - "op": "DUP1", - "pc": 2673, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20624, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2674, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20621, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2676, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20618, - "gasCost": 3, - "memory": null, - "op": "CALLER", - "pc": 2678, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20616, - "gasCost": 2, - "memory": null, - "op": "PUSH20", - "pc": 2679, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20613, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 2700, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20610, - "gasCost": 3, - "memory": null, - "op": "PUSH20", - "pc": 2701, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20607, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 2722, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20604, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2723, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20601, - "gasCost": 3, - "memory": null, - "op": "MSTORE", - "pc": 2724, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20598, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2725, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20595, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 2727, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20592, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 2728, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20589, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2729, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000003" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20586, - "gasCost": 3, - "memory": null, - "op": "MSTORE", - "pc": 2730, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20583, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2731, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20580, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 2733, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20577, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2734, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20574, - "gasCost": 3, - "memory": null, - "op": "SHA3", - "pc": 2736, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000040", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20532, - "gasCost": 42, - "memory": null, - "op": "PUSH1", - "pc": 2737, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20529, - "gasCost": 3, - "memory": null, - "op": "DUP3", - "pc": 2739, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20526, - "gasCost": 3, - "memory": null, - "op": "DUP3", - "pc": 2740, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20523, - "gasCost": 3, - "memory": null, - "op": "SLOAD", - "pc": 2741, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20323, - "gasCost": 200, - "memory": null, - "op": "SUB", - "pc": 2742, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20320, - "gasCost": 3, - "memory": null, - "op": "SWAP3", - "pc": 2743, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20317, - "gasCost": 3, - "memory": null, - "op": "POP", - "pc": 2744, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20315, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 2745, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20313, - "gasCost": 2, - "memory": null, - "op": "DUP2", - "pc": 2746, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20310, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 2747, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 20307, - "gasCost": 3, - "memory": null, - "op": "SSTORE", - "pc": 2748, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000", - "e8af3d9c3f2014e95dfc13b23432f282fb88d28d9985b050581f714c3cecb355" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15307, - "gasCost": 5000, - "memory": null, - "op": "POP", - "pc": 2749, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15305, - "gasCost": 2, - "memory": null, - "op": "CALLER", - "pc": 2750, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15303, - "gasCost": 2, - "memory": null, - "op": "PUSH20", - "pc": 2751, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15300, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 2772, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15297, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 2773, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15294, - "gasCost": 3, - "memory": null, - "op": "DUP3", - "pc": 2776, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "00000000000000000000000000000000000000000000000000000000000008fc" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15291, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 2777, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15288, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2778, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "00000000000000000000000000000000000000000000000000000000000008fc" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15285, - "gasCost": 3, - "memory": null, - "op": "ISZERO", - "pc": 2779, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15282, - "gasCost": 3, - "memory": null, - "op": "MUL", - "pc": 2780, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15277, - "gasCost": 5, - "memory": null, - "op": "SWAP1", - "pc": 2781, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15274, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2782, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15271, - "gasCost": 3, - "memory": null, - "op": "MLOAD", - "pc": 2784, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15268, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2785, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15265, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2787, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15262, - "gasCost": 3, - "memory": null, - "op": "MLOAD", - "pc": 2789, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15259, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 2790, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15256, - "gasCost": 3, - "memory": null, - "op": "DUP4", - "pc": 2791, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15253, - "gasCost": 3, - "memory": null, - "op": "SUB", - "pc": 2792, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15250, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2793, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15247, - "gasCost": 3, - "memory": null, - "op": "DUP6", - "pc": 2794, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15244, - "gasCost": 3, - "memory": null, - "op": "DUP9", - "pc": 2795, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15241, - "gasCost": 3, - "memory": null, - "op": "DUP9", - "pc": 2796, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 15238, - "gasCost": 3, - "memory": null, - "op": "CALL", - "pc": 2797, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7838, - "gasCost": 7400, - "memory": null, - "op": "SWAP4", - "pc": 2798, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7835, - "gasCost": 3, - "memory": null, - "op": "POP", - "pc": 2799, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7833, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 2800, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7831, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 2801, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001", - "00000000000000000000000000000000000000000000000000000000000008fc", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7829, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 2802, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001", - "00000000000000000000000000000000000000000000000000000000000008fc" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7827, - "gasCost": 2, - "memory": null, - "op": "ISZERO", - "pc": 2803, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7824, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 2804, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7821, - "gasCost": 3, - "memory": null, - "op": "ISZERO", - "pc": 2805, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7818, - "gasCost": 3, - "memory": null, - "op": "PUSH2", - "pc": 2806, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7815, - "gasCost": 3, - "memory": null, - "op": "JUMPI", - "pc": 2809, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000b03" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7805, - "gasCost": 10, - "memory": null, - "op": "JUMPDEST", - "pc": 2819, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7804, - "gasCost": 1, - "memory": null, - "op": "POP", - "pc": 2820, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7802, - "gasCost": 2, - "memory": null, - "op": "CALLER", - "pc": 2821, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7800, - "gasCost": 2, - "memory": null, - "op": "PUSH20", - "pc": 2822, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7797, - "gasCost": 3, - "memory": null, - "op": "AND", - "pc": 2843, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7794, - "gasCost": 3, - "memory": null, - "op": "PUSH32", - "pc": 2844, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7791, - "gasCost": 3, - "memory": null, - "op": "DUP3", - "pc": 2877, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7788, - "gasCost": 3, - "memory": null, - "op": "PUSH1", - "pc": 2878, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7785, - "gasCost": 3, - "memory": null, - "op": "MLOAD", - "pc": 2880, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7782, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 2881, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7779, - "gasCost": 3, - "memory": null, - "op": "DUP3", - "pc": 2882, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7776, - "gasCost": 3, - "memory": null, - "op": "DUP2", - "pc": 2883, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7773, - "gasCost": 3, - "memory": null, - "op": "MSTORE", - "pc": 2884, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7764, - "gasCost": 9, - "memory": null, - "op": "PUSH1", - "pc": 2885, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7761, - "gasCost": 3, - "memory": null, - "op": "ADD", - "pc": 2887, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7758, - "gasCost": 3, - "memory": null, - "op": "SWAP2", - "pc": 2888, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000000000000000000000000000000000000000000080", - "00000000000000000000000000000000000000000000000000000000000000a0" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7755, - "gasCost": 3, - "memory": null, - "op": "POP", - "pc": 2889, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "00000000000000000000000000000000000000000000000000000000000000a0", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7753, - "gasCost": 2, - "memory": null, - "op": "POP", - "pc": 2890, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "00000000000000000000000000000000000000000000000000000000000000a0", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7751, - "gasCost": 2, - "memory": null, - "op": "PUSH1", - "pc": 2891, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "00000000000000000000000000000000000000000000000000000000000000a0" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7748, - "gasCost": 3, - "memory": null, - "op": "MLOAD", - "pc": 2893, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "00000000000000000000000000000000000000000000000000000000000000a0", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7745, - "gasCost": 3, - "memory": null, - "op": "DUP1", - "pc": 2894, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "00000000000000000000000000000000000000000000000000000000000000a0", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7742, - "gasCost": 3, - "memory": null, - "op": "SWAP2", - "pc": 2895, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "00000000000000000000000000000000000000000000000000000000000000a0", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7739, - "gasCost": 3, - "memory": null, - "op": "SUB", - "pc": 2896, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000080", - "00000000000000000000000000000000000000000000000000000000000000a0" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7736, - "gasCost": 3, - "memory": null, - "op": "SWAP1", - "pc": 2897, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000000000000000080", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 7733, - "gasCost": 3, - "memory": null, - "op": "LOG2", - "pc": 2898, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0000000000000000000000005409ed021d9299bf6814279a6a1411a7e866a631", - "7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000080" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 6352, - "gasCost": 1381, - "memory": null, - "op": "POP", - "pc": 2899, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289", - "0000000000000000000000000000000000000000000000000de0b6b3a7640000" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 6350, - "gasCost": 2, - "memory": null, - "op": "JUMP", - "pc": 2900, - "stack": [ - "000000000000000000000000000000000000000000000000000000002e1a7d4d", - "0000000000000000000000000000000000000000000000000000000000000289" - ], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 6342, - "gasCost": 8, - "memory": null, - "op": "JUMPDEST", - "pc": 649, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - }, - { - "depth": 0, - "error": "", - "gas": 6341, - "gasCost": 1, - "memory": null, - "op": "STOP", - "pc": 650, - "stack": ["000000000000000000000000000000000000000000000000000000002e1a7d4d"], - "storage": null - } -] -- cgit v1.2.3 From 06be580d2cbe7e3543d8c4deeb4d1c22b325e6a7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 13:21:44 -0700 Subject: Fix a bug in CALL-like opcode handling --- packages/contracts/src/utils/web3_wrapper.ts | 3 ++- packages/contracts/test/utils/coverage.ts | 6 +++--- packages/sol-cov/src/trace.ts | 24 +++++++++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/contracts/src/utils/web3_wrapper.ts b/packages/contracts/src/utils/web3_wrapper.ts index 5d3d9f7c9..02595506b 100644 --- a/packages/contracts/src/utils/web3_wrapper.ts +++ b/packages/contracts/src/utils/web3_wrapper.ts @@ -13,6 +13,7 @@ const providerConfigs = { shouldUseInProcessGanache: true }; export const provider = web3Factory.getRpcProvider(providerConfigs); const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); if (isCoverageEnabled) { - prependSubprovider(provider, coverage.getCoverageSubproviderSingleton()); + const coverageSubprovider = coverage.getCoverageSubproviderSingleton(); + prependSubprovider(provider, coverageSubprovider); } export const web3Wrapper = new Web3Wrapper(provider); diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts index eeb47667f..3b2a8d7b2 100644 --- a/packages/contracts/test/utils/coverage.ts +++ b/packages/contracts/test/utils/coverage.ts @@ -16,8 +16,8 @@ export const coverage = { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; const CONFIG_FILE = 'compiler.json'; const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); - const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir); - const coverageSubrpovider = new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); - return coverageSubprovider; + const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir); + const subprovider = new CoverageSubprovider(solCompilerArtifactAdapter, defaultFromAddress); + return subprovider; }, }; diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 81c8bb0ff..feebaaab5 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -13,7 +13,8 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress let currentTraceSegment = []; const callStack = [startAddress]; // tslint:disable-next-line:prefer-for-of - for (const structLog of structLogs) { + for (let i = 0; i < structLogs.length; i++) { + const structLog = structLogs[i]; if (structLog.depth !== callStack.length - 1) { throw new Error("Malformed trace. trace depth doesn't match call stack depth"); } @@ -26,13 +27,22 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress const currentAddress = _.last(callStack) as string; const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2; const newAddress = addressUtils.padZeros( - new BigNumber(addHexPrefix(structLog.stack[jumpAddressOffset])).toString(16), + new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset])).toString(16), ); - callStack.push(newAddress); - traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( - currentTraceSegment, - ); - currentTraceSegment = []; + if (structLog === _.last(structLogs)) { + throw new Error('CALL-like opcode can not be the last one'); + } + // Sometimes calls don't change the execution context (current address). When we do a transfer to an + // externally owned account - it does the call and immidiately returns because there is no fallback + // function. We manually check if the call depth had changed to handle that case. + const nextStructLog = structLogs[i + 1]; + if (nextStructLog.depth !== structLog.depth) { + callStack.push(newAddress); + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + } } else if ( _.includes([OpCode.Return, OpCode.Stop, OpCode.Revert, OpCode.Invalid, OpCode.SelfDestruct], structLog.op) ) { -- cgit v1.2.3 From 9740199870d83dc999079883754ec512c1ff544b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 13:44:48 -0700 Subject: Fix sol-cov tests --- packages/sol-cov/src/trace.ts | 4 +++- packages/sol-cov/test/trace_test.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index feebaaab5..389bd8309 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -27,7 +27,9 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress const currentAddress = _.last(callStack) as string; const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2; const newAddress = addressUtils.padZeros( - new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset])).toString(16), + new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset - 1])).toString( + 16, + ), ); if (structLog === _.last(structLogs)) { throw new Error('CALL-like opcode can not be the last one'); diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts index 2d6697ce5..93696b04a 100644 --- a/packages/sol-cov/test/trace_test.ts +++ b/packages/sol-cov/test/trace_test.ts @@ -32,7 +32,7 @@ describe('Trace', () => { const trace = [ { op: OpCode.DelegateCall, - stack: ['0x', '0x', '0x', '0x', delegateCallAddress], + stack: [delegateCallAddress, '0x', '0x', '0x', '0x'], depth: 0, }, { -- cgit v1.2.3 From 127b3e7d60aa5b5256d3d77aecf5efb239649957 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 14:48:23 -0700 Subject: Fix sol-compiler version --- packages/sol-cov/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 0edffb1d2..74ffa72bd 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -46,7 +46,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { - "@0xproject/sol-compiler": "^0.4.3", + "@0xproject/sol-compiler": "^0.5.0", "@0xproject/subproviders": "^0.10.2", "@0xproject/types": "^0.7.0", "@0xproject/typescript-typings": "^0.3.2", -- cgit v1.2.3 From 6e0aef5f2bd8cd3ca9086abf4794028feac5ae9b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 15:14:07 -0700 Subject: Fix depth tracking in a tracer --- packages/sol-cov/src/trace.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 389bd8309..28fc7d004 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -25,7 +25,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress if (_.includes([OpCode.CallCode, OpCode.StaticCall, OpCode.Call, OpCode.DelegateCall], structLog.op)) { const currentAddress = _.last(callStack) as string; - const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2; + const jumpAddressOffset = 1; const newAddress = addressUtils.padZeros( new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset - 1])).toString( 16, @@ -65,6 +65,21 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress "Detected a contract created from within another contract. Sol-cov currently doesn't support that scenario. We'll just skip that trace", ); return traceByContractAddress; + } else { + if (structLog !== _.last(structLogs)) { + const nextStructLog = structLogs[i + 1]; + if (nextStructLog.depth === structLog.depth) { + continue; + } else if (nextStructLog.depth === structLog.depth - 1) { + const currentAddress = callStack.pop() as string; + traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( + currentTraceSegment, + ); + currentTraceSegment = []; + } else { + throw new Error('Shit broke'); + } + } } } if (callStack.length !== 0) { -- cgit v1.2.3 From 68321362c53db791338d4bbe1828052ed89d4e7d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 15:45:44 -0700 Subject: Remove 0x.js dependency from sra-report --- packages/sra-report/package.json | 3 ++- packages/sra-report/src/postman_environment_factory.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 0ab83f5f7..810acab1c 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -31,8 +31,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-report/README.md", "dependencies": { - "0x.js": "^0.38.0", "@0xproject/assert": "^0.2.10", + "@0xproject/types": "^0.7.0", + "@0xproject/order-utils": "^0.0.5", "@0xproject/connect": "^0.6.13", "@0xproject/json-schemas": "^0.7.24", "@0xproject/typescript-typings": "^0.3.2", diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index e899aaa79..f8fe02d72 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -1,6 +1,7 @@ -import { SignedOrder, ZeroEx } from '0x.js'; import { HttpClient } from '@0xproject/connect'; import { Schema, schemas as schemasByName } from '@0xproject/json-schemas'; +import { getOrderHashHex } from '@0xproject/order-utils'; +import { SignedOrder } from '@0xproject/types'; import { logUtils } from '@0xproject/utils'; import chalk from 'chalk'; import * as _ from 'lodash'; @@ -98,7 +99,7 @@ async function createOrderEnvironmentValuesAsync(url: string): Promise Date: Tue, 22 May 2018 16:29:10 -0700 Subject: Add a more verbose comment for self-destruct --- packages/sol-cov/src/trace.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 28fc7d004..4d106e355 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -54,7 +54,11 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress ); currentTraceSegment = []; if (structLog.op === OpCode.SelfDestruct) { - // TODO: Record contract bytecode before the selfdestruct and handle that scenario + // After contract execution, we look at all sub-calls to external contracts, and for each one, fetch + // the bytecode and compute the coverage for the call. If the contract is destroyed with a call + // to `selfdestruct`, we are unable to fetch it's bytecode and compute coverage. + // TODO: Refactor this logic to fetch the sub-called contract bytecode before the selfdestruct is called + // in order to handle this edge-case. logUtils.warn( "Detected a selfdestruct. Sol-cov currently doesn't support that scenario. We'll just skip the trace part for a destructed contract", ); -- cgit v1.2.3 From 1578402cbe308260dcebb62a11b0460b998d2793 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 16:37:04 -0700 Subject: Fix TokenTransferProxy artifact name since it's now suffixed with _v1 --- packages/contract-wrappers/package.json | 2 +- packages/migrations/src/artifacts.ts | 2 +- packages/order-watcher/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 6cb16c2c0..f75ea1b52 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -27,7 +27,7 @@ }, "config": { "compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry", - "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", + "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy_v1 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", "postpublish": { "assets": [ "packages/contract-wrappers/_bundles/index.js", diff --git a/packages/migrations/src/artifacts.ts b/packages/migrations/src/artifacts.ts index 61b0c3085..acc267256 100644 --- a/packages/migrations/src/artifacts.ts +++ b/packages/migrations/src/artifacts.ts @@ -5,7 +5,7 @@ import * as Exchange from '../artifacts/1.0.0/Exchange_v1.json'; import * as MultiSigWalletWithTimeLock from '../artifacts/1.0.0/MultiSigWalletWithTimeLock.json'; import * as MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress from '../artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json'; import * as TokenRegistry from '../artifacts/1.0.0/TokenRegistry.json'; -import * as TokenTransferProxy from '../artifacts/1.0.0/TokenTransferProxy.json'; +import * as TokenTransferProxy from '../artifacts/1.0.0/TokenTransferProxy_v1.json'; import * as EtherToken from '../artifacts/1.0.0/WETH9.json'; import * as ZRX from '../artifacts/1.0.0/ZRXToken.json'; diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index d65d3f175..bb7d99459 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -28,7 +28,7 @@ }, "config": { "compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry", - "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", + "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy_v1 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", "postpublish": { "assets": [ "packages/order-watcher/_bundles/index.js", -- cgit v1.2.3 From 05cabded020c5c50378af76ac638b0f9c73fab1e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 16:37:17 -0700 Subject: Fix signature verification test --- packages/order-utils/src/signature_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index 28a8e7241..ebd636b20 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -99,7 +99,7 @@ function parseSignatureHexAsVRS(signatureHex: string): ECSignature { // HACK: Sometimes v is returned as [0, 1] and sometimes as [27, 28] // If it is returned as [0, 1], add 27 to both so it becomes [27, 28] const lowestValidV = 27; - const isProperlyFormattedV = v < lowestValidV; + const isProperlyFormattedV = v >= lowestValidV; if (!isProperlyFormattedV) { v += lowestValidV; } -- cgit v1.2.3 From 1b8204dabe1d6f69b782233b46e5f283beec1437 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 16:37:33 -0700 Subject: Update yarn.lock --- yarn.lock | 117 -------------------------------------------------------------- 1 file changed, 117 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0b95aca58..98215f54b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,98 +6,12 @@ version "0.3.9" resolved "https://registry.yarnpkg.com/8fold-marked/-/8fold-marked-0.3.9.tgz#bb89c645612f8ccfaffac1ca6e3c11f168c9cf59" -"@0xproject/assert@^0.2.10": - version "0.2.10" - resolved "https://registry.yarnpkg.com/@0xproject/assert/-/assert-0.2.10.tgz#733bcf7f9483ac65f1d68fbc6534322242c4b919" - dependencies: - "@0xproject/json-schemas" "^0.7.24" - "@0xproject/typescript-typings" "^0.3.2" - "@0xproject/utils" "^0.6.2" - lodash "^4.17.4" - valid-url "^1.0.9" - -"@0xproject/base-contract@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@0xproject/base-contract/-/base-contract-0.3.2.tgz#d7ffdc6ae26fc73bbd43b62dafcfae019d8f984a" - dependencies: - "@0xproject/types" "^0.7.0" - "@0xproject/typescript-typings" "^0.3.2" - "@0xproject/utils" "^0.6.2" - "@0xproject/web3-wrapper" "^0.6.4" - ethers "^3.0.15" - lodash "^4.17.4" - -"@0xproject/contract-wrappers@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@0xproject/contract-wrappers/-/contract-wrappers-0.0.2.tgz#6e297db4650eeabc7d3d2f7c39d64561c021eab6" - dependencies: - "@0xproject/assert" "^0.2.10" - "@0xproject/base-contract" "^0.3.2" - "@0xproject/fill-scenarios" "^0.0.2" - "@0xproject/json-schemas" "^0.7.24" - "@0xproject/order-utils" "^0.0.5" - "@0xproject/types" "^0.7.0" - "@0xproject/typescript-typings" "^0.3.2" - "@0xproject/utils" "^0.6.2" - "@0xproject/web3-wrapper" "^0.6.4" - ethereumjs-blockstream "^2.0.6" - ethereumjs-util "^5.1.1" - ethers "^3.0.15" - js-sha3 "^0.7.0" - lodash "^4.17.4" - uuid "^3.1.0" - -"@0xproject/fill-scenarios@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@0xproject/fill-scenarios/-/fill-scenarios-0.0.2.tgz#176ac2cba13f527e84346fbf06da84965a852bab" - dependencies: - "@0xproject/base-contract" "^0.3.2" - "@0xproject/order-utils" "^0.0.5" - "@0xproject/types" "^0.7.0" - "@0xproject/typescript-typings" "^0.3.2" - "@0xproject/utils" "^0.6.2" - "@0xproject/web3-wrapper" "^0.6.4" - ethers "^3.0.15" - lodash "^4.17.4" - -"@0xproject/json-schemas@^0.7.24": - version "0.7.24" - resolved "https://registry.yarnpkg.com/@0xproject/json-schemas/-/json-schemas-0.7.24.tgz#21a12b43ab0ab4aa302d02c4891668cda36b6c64" - dependencies: - "@0xproject/typescript-typings" "^0.3.2" - "@types/node" "^8.0.53" - jsonschema "^1.2.0" - lodash.values "^4.3.0" - -"@0xproject/order-utils@^0.0.5": - version "0.0.5" - resolved "https://registry.yarnpkg.com/@0xproject/order-utils/-/order-utils-0.0.5.tgz#c8d92a112740b0020e08f13137844f8c183c863b" - dependencies: - "@0xproject/assert" "^0.2.10" - "@0xproject/json-schemas" "^0.7.24" - "@0xproject/types" "^0.7.0" - "@0xproject/typescript-typings" "^0.3.2" - "@0xproject/utils" "^0.6.2" - "@0xproject/web3-wrapper" "^0.6.4" - "@types/node" "^8.0.53" - bn.js "^4.11.8" - ethereumjs-abi "^0.6.4" - ethereumjs-util "^5.1.1" - lodash "^4.17.4" - "@0xproject/types@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.5.0.tgz#ba3cfbc11a8c6344b57c9680aa7df2ea84b9bf05" dependencies: bignumber.js "~4.1.0" -"@0xproject/types@^0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.7.0.tgz#fad13925ee92ad4ee1980668a5cb2bed4dcaab8f" - dependencies: - "@types/node" "^8.0.53" - bignumber.js "~4.1.0" - "@0xproject/typescript-typings@^0.0.3": version "0.0.3" resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-0.0.3.tgz#3272080bde00ade0a970b0d236686b483b08a1d0" @@ -105,37 +19,6 @@ "@0xproject/types" "^0.5.0" bignumber.js "~4.1.0" -"@0xproject/typescript-typings@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@0xproject/typescript-typings/-/typescript-typings-0.3.2.tgz#abc360b441afda993100450ca8369dfabf75936b" - dependencies: - "@0xproject/types" "^0.7.0" - bignumber.js "~4.1.0" - -"@0xproject/utils@^0.6.2": - version "0.6.2" - resolved "https://registry.yarnpkg.com/@0xproject/utils/-/utils-0.6.2.tgz#79056a0a7be88581bcb92bce01a0f1f1b3074397" - dependencies: - "@0xproject/types" "^0.7.0" - "@0xproject/typescript-typings" "^0.3.2" - "@types/node" "^8.0.53" - bignumber.js "~4.1.0" - ethers "^3.0.15" - js-sha3 "^0.7.0" - lodash "^4.17.4" - web3 "^0.20.0" - -"@0xproject/web3-wrapper@^0.6.4": - version "0.6.4" - resolved "https://registry.yarnpkg.com/@0xproject/web3-wrapper/-/web3-wrapper-0.6.4.tgz#fb15b71cdf4e5001c2b2e0d316b0de485a2be5f8" - dependencies: - "@0xproject/types" "^0.7.0" - "@0xproject/typescript-typings" "^0.3.2" - "@0xproject/utils" "^0.6.2" - ethers "^3.0.15" - lodash "^4.17.4" - web3 "^0.20.0" - "@ledgerhq/hw-app-eth@^4.3.0": version "4.7.3" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.7.3.tgz#d352e19658ae296532e522c53c8ec2a1a77b64e5" -- cgit v1.2.3 From 706bfafe74f289feb98021c1303ca27c342c2f14 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 16:37:04 -0700 Subject: Fix TokenTransferProxy artifact name since it's now suffixed with _v1 --- packages/contract-wrappers/package.json | 2 +- packages/migrations/src/artifacts.ts | 2 +- packages/order-watcher/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 9dd6f097d..10719c831 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -27,7 +27,7 @@ }, "config": { "compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry", - "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", + "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy_v1 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", "postpublish": { "assets": [ "packages/contract-wrappers/_bundles/index.js", diff --git a/packages/migrations/src/artifacts.ts b/packages/migrations/src/artifacts.ts index 61b0c3085..acc267256 100644 --- a/packages/migrations/src/artifacts.ts +++ b/packages/migrations/src/artifacts.ts @@ -5,7 +5,7 @@ import * as Exchange from '../artifacts/1.0.0/Exchange_v1.json'; import * as MultiSigWalletWithTimeLock from '../artifacts/1.0.0/MultiSigWalletWithTimeLock.json'; import * as MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress from '../artifacts/1.0.0/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.json'; import * as TokenRegistry from '../artifacts/1.0.0/TokenRegistry.json'; -import * as TokenTransferProxy from '../artifacts/1.0.0/TokenTransferProxy.json'; +import * as TokenTransferProxy from '../artifacts/1.0.0/TokenTransferProxy_v1.json'; import * as EtherToken from '../artifacts/1.0.0/WETH9.json'; import * as ZRX from '../artifacts/1.0.0/ZRXToken.json'; diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 2bd7e4dcb..c84858bfd 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -28,7 +28,7 @@ }, "config": { "compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry", - "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", + "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy_v1 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", "postpublish": { "assets": [ "packages/order-watcher/_bundles/index.js", -- cgit v1.2.3 From d49f2c40ae28bde3574907a72c0fdd84196e8303 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 16:41:50 -0700 Subject: Parse compiler.json in SolCompilerArtifactsAdapter --- packages/contracts/test/utils/coverage.ts | 4 +--- .../artifact_adapters/sol_compiler_artifact_adapter.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts index 3b2a8d7b2..a37939464 100644 --- a/packages/contracts/test/utils/coverage.ts +++ b/packages/contracts/test/utils/coverage.ts @@ -14,9 +14,7 @@ export const coverage = { }, _getCoverageSubprovider(): CoverageSubprovider { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - const CONFIG_FILE = 'compiler.json'; - const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); - const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir); + const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(); const subprovider = new CoverageSubprovider(solCompilerArtifactAdapter, defaultFromAddress); return subprovider; }, diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts index cb164f769..d08828bf6 100644 --- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts @@ -7,13 +7,22 @@ import { ContractData } from '../types'; import { AbstractArtifactAdapter } from './abstract_artifact_adapter'; +const CONFIG_FILE = 'compiler.json'; + export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { private _artifactsPath: string; private _sourcesPath: string; - constructor(artifactsPath: string, sourcesPath: string) { + constructor(artifactsPath?: string, sourcesPath?: string) { super(); - this._artifactsPath = artifactsPath; - this._sourcesPath = sourcesPath; + const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); + if (_.isUndefined(artifactsPath) && _.isUndefined(config.artifactsDir)) { + throw new Error(`artifactsDir not found in ${CONFIG_FILE}`); + } + this._artifactsPath = config.artifactsDir; + if (_.isUndefined(sourcesPath) && _.isUndefined(config.contractsDir)) { + throw new Error(`contractsDir not found in ${CONFIG_FILE}`); + } + this._sourcesPath = config.contractsDir; } public async collectContractsDataAsync(): Promise { const artifactsGlob = `${this._artifactsPath}/**/*.json`; -- cgit v1.2.3 From 4d364ea26128f179fea0679294f43a7882db4e53 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 17:18:09 -0700 Subject: fix contract-wrappers version --- packages/contracts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 54912e72f..be3ca3bc4 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -64,7 +64,7 @@ }, "dependencies": { "@0xproject/base-contract": "^0.3.2", - "@0xproject/contract-wrappers": "^0.0.1", + "@0xproject/contract-wrappers": "^0.0.2", "@0xproject/order-utils": "^0.0.5", "@0xproject/sol-compiler": "^0.5.0", "@0xproject/types": "^0.7.0", -- cgit v1.2.3 From 85eb82acb22c317e30f68fa331898ddfc31b1611 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Tue, 22 May 2018 17:36:22 -0700 Subject: Update dogfood url --- packages/website/package.json | 2 +- packages/website/ts/utils/configs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 7d49581cd..b718aea4d 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -11,7 +11,7 @@ "clean": "shx rm -f public/bundle*", "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'", "watch": "webpack-dev-server --content-base public --https", - "deploy_dogfood": "npm run build; aws s3 sync ./public/. s3://dogfood-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", + "deploy_dogfood": "npm run build; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", "deploy_staging": "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", "deploy_live": "npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers" }, diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 9fec814b7..e72a7f201 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -19,7 +19,7 @@ export const configs = { // WARNING: ZRX & WETH MUST always be default trackedTokens DEFAULT_TRACKED_TOKEN_SYMBOLS: ['WETH', 'ZRX'], DOMAIN_STAGING: 'staging-0xproject.s3-website-us-east-1.amazonaws.com', - DOMAIN_DOGFOOD: 'dogfood-0xproject.s3-website-us-east-1.amazonaws.com', + DOMAIN_DOGFOOD: 'dogfood.0xproject.com', DOMAIN_DEVELOPMENT: '0xproject.localhost:3572', DOMAIN_PRODUCTION: '0xproject.com', ENVIRONMENT: isDevelopment ? Environments.DEVELOPMENT : Environments.PRODUCTION, -- cgit v1.2.3 From 61e487224fab2995b18b1534bfa83362b38b5725 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 17:36:41 -0700 Subject: Fix Tslint error caused by "PromiseLike" value --- packages/contracts/test/exchange/core.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 78b36dfc3..f1d9a4156 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -533,6 +533,9 @@ describe('Exchange core', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + // HACK: `rejectWith` returns a "promise-like" type, but not an actual "Promise", so TSLint + // complains, even though we do need to `await` it. So we disable the TSLint error below. + // tslint:disable-next-line:await-promise await expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( constants.REVERT, ); @@ -551,6 +554,9 @@ describe('Exchange core', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + // HACK: `rejectWith` returns a "promise-like" type, but not an actual "Promise", so TSLint + // complains, even though we do need to `await` it. So we disable the TSLint error below. + // tslint:disable-next-line:await-promise await expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( constants.REVERT, ); -- cgit v1.2.3 From f9ef6491e60c61ba4859c3411e971bcc21d77e4e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 22 May 2018 17:36:41 -0700 Subject: Fix Tslint error caused by "PromiseLike" value --- packages/contracts/test/exchange/core.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 1edd44aff..2c7a60c4e 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -538,6 +538,9 @@ describe('Exchange core', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + // HACK: `rejectWith` returns a "promise-like" type, but not an actual "Promise", so TSLint + // complains, even though we do need to `await` it. So we disable the TSLint error below. + // tslint:disable-next-line:await-promise await expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( constants.REVERT, ); @@ -556,6 +559,9 @@ describe('Exchange core', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + // HACK: `rejectWith` returns a "promise-like" type, but not an actual "Promise", so TSLint + // complains, even though we do need to `await` it. So we disable the TSLint error below. + // tslint:disable-next-line:await-promise await expect(exchangeWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith( constants.REVERT, ); -- cgit v1.2.3 From ebc750d5bf95da76424da81550a88e6b74de8c36 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 17:41:48 -0700 Subject: Address feedback --- packages/dev-utils/CHANGELOG.json | 2 +- packages/sol-cov/src/constants.ts | 2 +- packages/sol-cov/src/coverage_manager.ts | 4 +++- packages/sol-cov/src/coverage_subprovider.ts | 24 +++++++++++--------- packages/sol-cov/src/trace.ts | 34 +++++++++++++++++----------- 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index 4f6f7bd76..ecb43a42e 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -3,7 +3,7 @@ "version": "0.4.2", "changes": [ { - "note": "Pass ZeroExArtifactsAdapter to CoverageSubprovider", + "note": "Pass SolCompilerArtifactAdapter to CoverageSubprovider", "pr": 589 }, { diff --git a/packages/sol-cov/src/constants.ts b/packages/sol-cov/src/constants.ts index 64d2228a3..34d62b537 100644 --- a/packages/sol-cov/src/constants.ts +++ b/packages/sol-cov/src/constants.ts @@ -1,6 +1,6 @@ // tslint:disable:number-literal-format export const constants = { - NEW_CONTRACT: 'NEW_CONTRACT', + NEW_CONTRACT: 'NEW_CONTRACT' as 'NEW_CONTRACT', PUSH1: 0x60, PUSH2: 0x61, PUSH32: 0x7f, diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index ef893527a..31b0e6fbc 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -125,13 +125,15 @@ export class CoverageManager { } private static _getContractDataIfExists(contractsData: ContractData[], bytecode: string): ContractData | undefined { if (!bytecode.startsWith('0x')) { - throw new Error('0x missing'); + throw new Error(`0x hex prefix missing: ${bytecode}`); } const contractData = _.find(contractsData, contractDataCandidate => { const bytecodeRegex = CoverageManager._bytecodeToBytecodeRegex(contractDataCandidate.bytecode); const runtimeBytecodeRegex = CoverageManager._bytecodeToBytecodeRegex( contractDataCandidate.runtimeBytecode, ); + // We use that function to find by bytecode or runtimeBytecode. Those are quasi-random strings so + // collisions are practically impossible and it allows us to reuse that code return !_.isNull(bytecode.match(bytecodeRegex)) || !_.isNull(bytecode.match(runtimeBytecodeRegex)); }); return contractData; diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index 45b479c0e..438339a3f 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -31,13 +31,13 @@ export class CoverageSubprovider extends Subprovider { * Instantiates a CoverageSubprovider instance * @param artifactAdapter Adapter for used artifacts format (0x, truffle, giveth, etc.) * @param defaultFromAddress default from address to use when sending transactions - * @param verbose If true, we will log any unknown transactions. Otherwise we will ignore them + * @param isVerbose If true, we will log any unknown transactions. Otherwise we will ignore them */ - constructor(artifactAdapter: AbstractArtifactAdapter, defaultFromAddress: string, verbose: boolean = true) { + constructor(artifactAdapter: AbstractArtifactAdapter, defaultFromAddress: string, isVerbose: boolean = true) { super(); this._lock = new Lock(); this._defaultFromAddress = defaultFromAddress; - this._coverageManager = new CoverageManager(artifactAdapter, this._getContractCodeAsync.bind(this), verbose); + this._coverageManager = new CoverageManager(artifactAdapter, this._getContractCodeAsync.bind(this), isVerbose); } /** * Write the test coverage results to a file in Istanbul format. @@ -120,11 +120,12 @@ export class CoverageSubprovider extends Subprovider { method: 'debug_traceTransaction', params: [txHash, { disableMemory: true, disableStack: false, disableStorage: true }], }; - const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); + let jsonRPCResponsePayload = await this.emitPayloadAsync(payload); const trace: TransactionTrace = jsonRPCResponsePayload.result; + const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); + const subcallAddresses = _.keys(tracesByContractAddress); if (address === constants.NEW_CONTRACT) { - const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); - for (const subcallAddress of _.keys(tracesByContractAddress)) { + for (const subcallAddress of subcallAddresses) { let traceInfo: TraceInfoNewContract | TraceInfoExistingContract; if (subcallAddress === 'NEW_CONTRACT') { const traceForThatSubcall = tracesByContractAddress[subcallAddress]; @@ -132,12 +133,13 @@ export class CoverageSubprovider extends Subprovider { traceInfo = { coveredPcs, txHash, - address: address as 'NEW_CONTRACT', + address: constants.NEW_CONTRACT, bytecode: data as string, }; } else { payload = { method: 'eth_getCode', params: [subcallAddress, BlockParamLiteral.Latest] }; - const runtimeBytecode = (await this.emitPayloadAsync(payload)).result; + jsonRPCResponsePayload = await this.emitPayloadAsync(payload); + const runtimeBytecode = jsonRPCResponsePayload.result; const traceForThatSubcall = tracesByContractAddress[subcallAddress]; const coveredPcs = _.map(traceForThatSubcall, log => log.pc); traceInfo = { @@ -150,10 +152,10 @@ export class CoverageSubprovider extends Subprovider { this._coverageManager.appendTraceInfo(traceInfo); } } else { - const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address); - for (const subcallAddress of _.keys(tracesByContractAddress)) { + for (const subcallAddress of subcallAddresses) { payload = { method: 'eth_getCode', params: [subcallAddress, BlockParamLiteral.Latest] }; - const runtimeBytecode = (await this.emitPayloadAsync(payload)).result; + jsonRPCResponsePayload = await this.emitPayloadAsync(payload); + const runtimeBytecode = jsonRPCResponsePayload.result; const traceForThatSubcall = tracesByContractAddress[subcallAddress]; const coveredPcs = _.map(traceForThatSubcall, log => log.pc); const traceInfo: TraceInfoExistingContract = { diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 4d106e355..cb5410909 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -8,6 +8,10 @@ export interface TraceByContractAddress { [contractAddress: string]: StructLog[]; } +function getAddressFromStackEntry(stackEntry: string): string { + return addressUtils.padZeros(new BigNumber(addHexPrefix(stackEntry)).toString(16)); +} + export function getTracesByContractAddress(structLogs: StructLog[], startAddress: string): TraceByContractAddress { const traceByContractAddress: TraceByContractAddress = {}; let currentTraceSegment = []; @@ -16,26 +20,32 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress for (let i = 0; i < structLogs.length; i++) { const structLog = structLogs[i]; if (structLog.depth !== callStack.length - 1) { - throw new Error("Malformed trace. trace depth doesn't match call stack depth"); + throw new Error("Malformed trace. Trace depth doesn't match call stack depth"); } // After that check we have a guarantee that call stack is never empty // If it would: callStack.length - 1 === structLog.depth === -1 // That means that we can always safely pop from it currentTraceSegment.push(structLog); - if (_.includes([OpCode.CallCode, OpCode.StaticCall, OpCode.Call, OpCode.DelegateCall], structLog.op)) { + const isCallLike = _.includes( + [OpCode.CallCode, OpCode.StaticCall, OpCode.Call, OpCode.DelegateCall], + structLog.op, + ); + const isEndOpcode = _.includes( + [OpCode.Return, OpCode.Stop, OpCode.Revert, OpCode.Invalid, OpCode.SelfDestruct], + structLog.op, + ); + if (isCallLike) { const currentAddress = _.last(callStack) as string; const jumpAddressOffset = 1; - const newAddress = addressUtils.padZeros( - new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset - 1])).toString( - 16, - ), + const newAddress = getAddressFromStackEntry( + structLog.stack[structLog.stack.length - jumpAddressOffset - 1], ); if (structLog === _.last(structLogs)) { - throw new Error('CALL-like opcode can not be the last one'); + throw new Error('Malformed trace. CALL-like opcode can not be the last one'); } // Sometimes calls don't change the execution context (current address). When we do a transfer to an - // externally owned account - it does the call and immidiately returns because there is no fallback + // externally owned account - it does the call and immediately returns because there is no fallback // function. We manually check if the call depth had changed to handle that case. const nextStructLog = structLogs[i + 1]; if (nextStructLog.depth !== structLog.depth) { @@ -45,9 +55,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress ); currentTraceSegment = []; } - } else if ( - _.includes([OpCode.Return, OpCode.Stop, OpCode.Revert, OpCode.Invalid, OpCode.SelfDestruct], structLog.op) - ) { + } else if (isEndOpcode) { const currentAddress = callStack.pop() as string; traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat( currentTraceSegment, @@ -81,7 +89,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress ); currentTraceSegment = []; } else { - throw new Error('Shit broke'); + throw new Error('Malformed trace. Unexpected call depth change'); } } } @@ -90,7 +98,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress throw new Error('Malformed trace. Call stack non empty at the end'); } if (currentTraceSegment.length !== 0) { - throw new Error('Malformed trace. currentTraceSegment non empty at the end'); + throw new Error('Malformed trace. Current trace segment non empty at the end'); } return traceByContractAddress; } -- cgit v1.2.3 From e7e8773cd43121cdedff6151d379503ff899e595 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 22 May 2018 18:14:23 -0700 Subject: Fix small bug in order-utils --- packages/order-utils/src/signature_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index 28a8e7241..ebd636b20 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -99,7 +99,7 @@ function parseSignatureHexAsVRS(signatureHex: string): ECSignature { // HACK: Sometimes v is returned as [0, 1] and sometimes as [27, 28] // If it is returned as [0, 1], add 27 to both so it becomes [27, 28] const lowestValidV = 27; - const isProperlyFormattedV = v < lowestValidV; + const isProperlyFormattedV = v >= lowestValidV; if (!isProperlyFormattedV) { v += lowestValidV; } -- cgit v1.2.3 From 17cfd7b001a046e1014257da6b77b28c7a291e54 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 23 May 2018 08:37:43 -0700 Subject: Enable 0x.js tests --- packages/0x.js/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 6eff2fd9b..a498124b6 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -28,9 +28,7 @@ "build:umd:prod": "NODE_ENV=production webpack", "build:commonjs": "tsc && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "test:commonjs": "run-s build:commonjs run_mocha", - "_comment": {"run_mocha": "mocha lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", - "note": "The `run_mocha` test has been commented out by @hysz (greg@0xproject.com) until the migration package and 0x.js have been updated for V2."}, - "run_mocha": "", + "run_mocha": "mocha lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", -- cgit v1.2.3 From 5913d654bdf77d25b95570b1e656f63cc89ff97a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 16:18:52 -0700 Subject: Remove 0x.js as a dependency from website --- packages/website/package.json | 1 - packages/website/ts/blockchain.ts | 118 +++++++++++---------- .../dialogs/eth_weth_conversion_dialog.tsx | 4 +- .../ts/components/dialogs/ledger_config_dialog.tsx | 4 +- .../ts/components/eth_weth_conversion_button.tsx | 6 +- packages/website/ts/components/eth_wrappers.tsx | 8 +- packages/website/ts/components/fill_order.tsx | 14 +-- packages/website/ts/components/fill_order_json.tsx | 4 +- .../flash_messages/token_send_completed.tsx | 4 +- .../generate_order/generate_order_form.tsx | 11 +- .../ts/components/inputs/eth_amount_input.tsx | 6 +- .../website/ts/components/inputs/hash_input.tsx | 5 +- .../ts/components/inputs/token_amount_input.tsx | 8 +- packages/website/ts/components/order_json.tsx | 2 +- packages/website/ts/components/token_balances.tsx | 10 +- .../trade_history/trade_history_item.tsx | 16 ++- packages/website/ts/components/visual_order.tsx | 4 +- packages/website/ts/components/wallet/wallet.tsx | 6 +- .../ts/components/wallet/wrap_ether_item.tsx | 11 +- .../website/ts/containers/generate_order_form.ts | 2 +- packages/website/ts/redux/dispatcher.ts | 2 +- packages/website/ts/redux/reducer.ts | 7 +- packages/website/ts/types.ts | 2 +- packages/website/ts/utils/utils.ts | 4 +- 24 files changed, 137 insertions(+), 122 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index b718aea4d..e57404ca9 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -18,7 +18,6 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.38.0", "@0xproject/react-docs": "^0.0.12", "@0xproject/react-shared": "^0.1.7", "@0xproject/subproviders": "^0.10.2", diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 32acb9d43..17dbee5c8 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -1,20 +1,15 @@ import { - BlockParam, BlockRange, + ContractWrappers, DecodedLogEvent, - ECSignature, ExchangeContractEventArgs, ExchangeEvents, IndexedFilterValues, LogCancelContractEventArgs, LogFillContractEventArgs, - LogWithDecodedArgs, - Order, - SignedOrder, Token as ZeroExToken, - TransactionReceiptWithDecodedLogs, - ZeroEx, -} from '0x.js'; +} from '@0xproject/contract-wrappers'; +import { isValidOrderHash, signOrderHashAsync } from '@0xproject/order-utils'; import { EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared'; import { InjectedWeb3Subprovider, @@ -23,7 +18,15 @@ import { RedundantSubprovider, Subprovider, } from '@0xproject/subproviders'; -import { Provider } from '@0xproject/types'; +import { + BlockParam, + ECSignature, + LogWithDecodedArgs, + Order, + Provider, + SignedOrder, + TransactionReceiptWithDecodedLogs, +} from '@0xproject/types'; import { BigNumber, intervalUtils, logUtils, promisify } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -72,7 +75,7 @@ const providerToName: { [provider: string]: string } = { export class Blockchain { public networkId: number; public nodeVersion: string; - private _zeroEx: ZeroEx; + private _contractWrappers: ContractWrappers; private _dispatcher: Dispatcher; private _web3Wrapper?: Web3Wrapper; private _blockchainWatcher?: BlockchainWatcher; @@ -164,8 +167,8 @@ export class Blockchain { } } public async isAddressInTokenRegistryAsync(tokenAddress: string): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); - const tokenIfExists = await this._zeroEx.tokenRegistry.getTokenIfExistsAsync(tokenAddress); + utils.assert(!_.isUndefined(this._contractWrappers), 'Contract Wrappers must be instantiated.'); + const tokenIfExists = await this._contractWrappers.tokenRegistry.getTokenIfExistsAsync(tokenAddress); return !_.isUndefined(tokenIfExists); } public getLedgerDerivationPathIfExists(): string { @@ -182,7 +185,7 @@ export class Blockchain { this._ledgerSubprovider.setPath(path); } public async updateProviderToLedgerAsync(networkId: number): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'Contract Wrappers must be instantiated.'); const isU2FSupported = await utils.isU2FSupportedAsync(); if (!isU2FSupported) { @@ -225,12 +228,12 @@ export class Blockchain { this.networkId, shouldPollUserAddress, ); - this._zeroEx.setProvider(provider, this.networkId); + this._contractWrappers.setProvider(provider, this.networkId); this._blockchainWatcher.startEmittingNetworkConnectionAndUserBalanceState(); this._dispatcher.updateProviderType(ProviderType.Ledger); } public async updateProviderToInjectedAsync(): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'Contract Wrappers must be instantiated.'); if (_.isUndefined(this._cachedProvider)) { return; // Going from injected to injected, so we noop @@ -253,7 +256,7 @@ export class Blockchain { const userAddresses = await this._web3Wrapper.getAvailableAddressesAsync(); this._userAddressIfExists = userAddresses[0]; - this._zeroEx.setProvider(provider, this.networkId); + this._contractWrappers.setProvider(provider, this.networkId); await this.fetchTokenInformationAsync(); this._blockchainWatcher.startEmittingNetworkConnectionAndUserBalanceState(); @@ -264,10 +267,10 @@ export class Blockchain { public async setProxyAllowanceAsync(token: Token, amountInBaseUnits: BigNumber): Promise { utils.assert(this.isValidAddress(token.address), BlockchainCallErrs.TokenAddressIsInvalid); utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses); - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'Contract Wrappers must be instantiated.'); this._showFlashMessageIfLedger(); - const txHash = await this._zeroEx.token.setProxyAllowanceAsync( + const txHash = await this._contractWrappers.token.setProxyAllowanceAsync( token.address, this._userAddressIfExists, amountInBaseUnits, @@ -278,11 +281,11 @@ export class Blockchain { await this._showEtherScanLinkAndAwaitTransactionMinedAsync(txHash); } public async transferAsync(token: Token, toAddress: string, amountInBaseUnits: BigNumber): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses); this._showFlashMessageIfLedger(); - const txHash = await this._zeroEx.token.transferAsync( + const txHash = await this._contractWrappers.token.transferAsync( token.address, this._userAddressIfExists, toAddress, @@ -326,13 +329,13 @@ export class Blockchain { return zeroExSignedOrder; } public async fillOrderAsync(signedOrder: SignedOrder, fillTakerTokenAmount: BigNumber): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses); const shouldThrowOnInsufficientBalanceOrAllowance = true; this._showFlashMessageIfLedger(); - const txHash = await this._zeroEx.exchange.fillOrderAsync( + const txHash = await this._contractWrappers.exchange.fillOrderAsync( signedOrder, fillTakerTokenAmount, shouldThrowOnInsufficientBalanceOrAllowance, @@ -343,7 +346,7 @@ export class Blockchain { ); const receipt = await this._showEtherScanLinkAndAwaitTransactionMinedAsync(txHash); const logs: Array> = receipt.logs as any; - this._zeroEx.exchange.throwLogErrorsAsErrors(logs); + this._contractWrappers.exchange.throwLogErrorsAsErrors(logs); const logFill = _.find(logs, { event: 'LogFill' }); const args = (logFill.args as any) as LogFillContractEventArgs; const filledTakerTokenAmount = args.filledTakerTokenAmount; @@ -351,32 +354,32 @@ export class Blockchain { } public async cancelOrderAsync(signedOrder: SignedOrder, cancelTakerTokenAmount: BigNumber): Promise { this._showFlashMessageIfLedger(); - const txHash = await this._zeroEx.exchange.cancelOrderAsync(signedOrder, cancelTakerTokenAmount, { + const txHash = await this._contractWrappers.exchange.cancelOrderAsync(signedOrder, cancelTakerTokenAmount, { gasPrice: this._defaultGasPrice, }); const receipt = await this._showEtherScanLinkAndAwaitTransactionMinedAsync(txHash); const logs: Array> = receipt.logs as any; - this._zeroEx.exchange.throwLogErrorsAsErrors(logs); + this._contractWrappers.exchange.throwLogErrorsAsErrors(logs); const logCancel = _.find(logs, { event: ExchangeEvents.LogCancel }); const args = (logCancel.args as any) as LogCancelContractEventArgs; const cancelledTakerTokenAmount = args.cancelledTakerTokenAmount; return cancelledTakerTokenAmount; } public async getUnavailableTakerAmountAsync(orderHash: string): Promise { - utils.assert(ZeroEx.isValidOrderHash(orderHash), 'Must be valid orderHash'); - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); - const unavailableTakerAmount = await this._zeroEx.exchange.getUnavailableTakerAmountAsync(orderHash); + utils.assert(isValidOrderHash(orderHash), 'Must be valid orderHash'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); + const unavailableTakerAmount = await this._contractWrappers.exchange.getUnavailableTakerAmountAsync(orderHash); return unavailableTakerAmount; } public getExchangeContractAddressIfExists(): string | undefined { - return this._zeroEx.exchange.getContractAddress(); + return this._contractWrappers.exchange.getContractAddress(); } public async validateFillOrderThrowIfInvalidAsync( signedOrder: SignedOrder, fillTakerTokenAmount: BigNumber, takerAddress: string, ): Promise { - await this._zeroEx.exchange.validateFillOrderThrowIfInvalidAsync( + await this._contractWrappers.exchange.validateFillOrderThrowIfInvalidAsync( signedOrder, fillTakerTokenAmount, takerAddress, @@ -386,7 +389,7 @@ export class Blockchain { order: Order, cancelTakerTokenAmount: BigNumber, ): Promise { - await this._zeroEx.exchange.validateCancelOrderThrowIfInvalidAsync(order, cancelTakerTokenAmount); + await this._contractWrappers.exchange.validateCancelOrderThrowIfInvalidAsync(order, cancelTakerTokenAmount); } public isValidAddress(address: string): boolean { const lowercaseAddress = address.toLowerCase(); @@ -421,7 +424,7 @@ export class Blockchain { return newTokenBalancePromise; } public async signOrderHashAsync(orderHash: string): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); const makerAddress = this._userAddressIfExists; // If makerAddress is undefined, this means they have a web3 instance injected into their browser // but no account addresses associated with it. @@ -438,11 +441,8 @@ export class Blockchain { if ((isParityNode && !isLedgerSigner) || isTestRpc || isLedgerSigner) { shouldAddPersonalMessagePrefix = false; } - const ecSignature = await this._zeroEx.signOrderHashAsync( - orderHash, - makerAddress, - shouldAddPersonalMessagePrefix, - ); + const provider = this._contractWrappers.getProvider(); + const ecSignature = await signOrderHashAsync(provider, orderHash, makerAddress, shouldAddPersonalMessagePrefix); this._dispatcher.updateECSignature(ecSignature); return ecSignature; } @@ -461,11 +461,11 @@ export class Blockchain { return balanceInWei; } public async convertEthToWrappedEthTokensAsync(etherTokenAddress: string, amount: BigNumber): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses); this._showFlashMessageIfLedger(); - const txHash = await this._zeroEx.etherToken.depositAsync( + const txHash = await this._contractWrappers.etherToken.depositAsync( etherTokenAddress, amount, this._userAddressIfExists, @@ -476,11 +476,11 @@ export class Blockchain { await this._showEtherScanLinkAndAwaitTransactionMinedAsync(txHash); } public async convertWrappedEthTokensToEthAsync(etherTokenAddress: string, amount: BigNumber): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses); this._showFlashMessageIfLedger(); - const txHash = await this._zeroEx.etherToken.withdrawAsync( + const txHash = await this._contractWrappers.etherToken.withdrawAsync( etherTokenAddress, amount, this._userAddressIfExists, @@ -507,7 +507,7 @@ export class Blockchain { ownerAddressIfExists: string, tokenAddress: string, ): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); if (_.isUndefined(ownerAddressIfExists)) { const zero = new BigNumber(0); @@ -516,14 +516,16 @@ export class Blockchain { let balance = new BigNumber(0); let allowance = new BigNumber(0); if (this._doesUserAddressExist()) { - balance = await this._zeroEx.token.getBalanceAsync(tokenAddress, ownerAddressIfExists); - allowance = await this._zeroEx.token.getProxyAllowanceAsync(tokenAddress, ownerAddressIfExists); + balance = await this._contractWrappers.token.getBalanceAsync(tokenAddress, ownerAddressIfExists); + allowance = await this._contractWrappers.token.getProxyAllowanceAsync(tokenAddress, ownerAddressIfExists); } return [balance, allowance]; } public async getUserAccountsAsync(): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); - const userAccountsIfExists = await this._zeroEx.getAvailableAddressesAsync(); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); + const provider = this._contractWrappers.getProvider(); + const web3Wrapper = new Web3Wrapper(provider); + const userAccountsIfExists = await web3Wrapper.getAvailableAddressesAsync(); return userAccountsIfExists; } // HACK: When a user is using a Ledger, we simply dispatch the selected userAddress, which @@ -619,7 +621,9 @@ export class Blockchain { etherScanLinkIfExists, }), ); - const receipt = await this._zeroEx.awaitTransactionMinedAsync(txHash); + const provider = this._contractWrappers.getProvider(); + const web3Wrapper = new Web3Wrapper(provider); + const receipt = await web3Wrapper.awaitTransactionMinedAsync(txHash); return receipt; } private _doesUserAddressExist(): boolean { @@ -633,7 +637,7 @@ export class Blockchain { return; // short-circuit } - if (!_.isUndefined(this._zeroEx)) { + if (!_.isUndefined(this._contractWrappers)) { // Since we do not have an index on the `taker` address and want to show // transactions where an account is either the `maker` or `taker`, we loop // through all fill events, and filter/cache them client-side. @@ -642,14 +646,14 @@ export class Blockchain { } } private async _startListeningForExchangeLogFillEventsAsync(indexFilterValues: IndexedFilterValues): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses); // Fetch historical logs await this._fetchHistoricalExchangeLogFillEventsAsync(indexFilterValues); // Start a subscription for new logs - this._zeroEx.exchange.subscribe( + this._contractWrappers.exchange.subscribe( ExchangeEvents.LogFill, indexFilterValues, async (err: Error, decodedLogEvent: DecodedLogEvent) => { @@ -684,7 +688,7 @@ export class Blockchain { fromBlock, toBlock: 'latest' as BlockParam, }; - const decodedLogs = await this._zeroEx.exchange.getLogsAsync( + const decodedLogs = await this._contractWrappers.exchange.getLogsAsync( ExchangeEvents.LogFill, blockRange, indexFilterValues, @@ -741,11 +745,11 @@ export class Blockchain { } } private _stopWatchingExchangeLogFillEvents(): void { - this._zeroEx.exchange.unsubscribeAll(); + this._contractWrappers.exchange.unsubscribeAll(); } private async _getTokenRegistryTokensByAddressAsync(): Promise { - utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); - const tokenRegistryTokens = await this._zeroEx.tokenRegistry.getTokensAsync(); + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); + const tokenRegistryTokens = await this._contractWrappers.tokenRegistry.getTokensAsync(); const tokenByAddress: TokenByAddress = {}; _.each(tokenRegistryTokens, (t: ZeroExToken, i: number) => { @@ -787,14 +791,12 @@ export class Blockchain { const provider = await Blockchain._getProviderAsync(injectedWeb3, networkIdIfExists); this.networkId = !_.isUndefined(networkIdIfExists) ? networkIdIfExists - : configs.IS_MAINNET_ENABLED - ? constants.NETWORK_ID_MAINNET - : constants.NETWORK_ID_KOVAN; + : configs.IS_MAINNET_ENABLED ? constants.NETWORK_ID_MAINNET : constants.NETWORK_ID_KOVAN; this._dispatcher.updateNetworkId(this.networkId); const zeroExConfigs = { networkId: this.networkId, }; - this._zeroEx = new ZeroEx(provider, zeroExConfigs); + this._contractWrappers = new ContractWrappers(provider, zeroExConfigs); this._updateProviderName(injectedWeb3); const shouldPollUserAddress = true; this._web3Wrapper = new Web3Wrapper(provider); diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx index 069a75560..d647bba80 100644 --- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx +++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx @@ -1,6 +1,6 @@ -import { ZeroEx } from '0x.js'; import { colors } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; @@ -78,7 +78,7 @@ export class EthWethConversionDialog extends React.Component< ? 'Convert your Ether into a tokenized, tradable form.' : "Convert your Wrapped Ether back into it's native form."; const isWrappedVersion = this.props.direction === Side.Receive; - const etherBalanceInEth = ZeroEx.toUnitAmount(this.props.etherBalanceInWei, constants.DECIMAL_PLACES_ETH); + const etherBalanceInEth = Web3Wrapper.toUnitAmount(this.props.etherBalanceInWei, constants.DECIMAL_PLACES_ETH); return (
{explanation}
diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx index 3c839d6f5..196414407 100644 --- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx +++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx @@ -1,6 +1,6 @@ -import { ZeroEx } from '0x.js'; import { colors, constants as sharedConstants } from '@0xproject/react-shared'; import { BigNumber, logUtils } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; @@ -168,7 +168,7 @@ export class LedgerConfigDialog extends React.Component diff --git a/packages/website/ts/components/eth_weth_conversion_button.tsx b/packages/website/ts/components/eth_weth_conversion_button.tsx index e8db42a7a..4b91a2ebd 100644 --- a/packages/website/ts/components/eth_weth_conversion_button.tsx +++ b/packages/website/ts/components/eth_weth_conversion_button.tsx @@ -1,5 +1,5 @@ -import { ZeroEx } from '0x.js'; import { BigNumber, logUtils } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import RaisedButton from 'material-ui/RaisedButton'; import * as React from 'react'; @@ -95,11 +95,11 @@ export class EthWethConversionButton extends React.Component< try { if (direction === Side.Deposit) { await this.props.blockchain.convertEthToWrappedEthTokensAsync(token.address, value); - const ethAmount = ZeroEx.toUnitAmount(value, constants.DECIMAL_PLACES_ETH); + const ethAmount = Web3Wrapper.toUnitAmount(value, constants.DECIMAL_PLACES_ETH); this.props.dispatcher.showFlashMessage(`Successfully wrapped ${ethAmount.toString()} ETH to WETH`); } else { await this.props.blockchain.convertWrappedEthTokensToEthAsync(token.address, value); - const tokenAmount = ZeroEx.toUnitAmount(value, token.decimals); + const tokenAmount = Web3Wrapper.toUnitAmount(value, token.decimals); this.props.dispatcher.showFlashMessage(`Successfully unwrapped ${tokenAmount.toString()} WETH to ETH`); } if (!this.props.isOutdatedWrappedEther) { diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx index f19b05861..a5758a66a 100644 --- a/packages/website/ts/components/eth_wrappers.tsx +++ b/packages/website/ts/components/eth_wrappers.tsx @@ -1,6 +1,6 @@ -import { ZeroEx } from '0x.js'; import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import Divider from 'material-ui/Divider'; import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; @@ -85,7 +85,7 @@ export class EthWrappers extends React.Component { takerTokenAddress: parsedOrder.signedOrder.takerTokenAddress, takerTokenAmount: takerAmount, }; - orderHash = ZeroEx.getOrderHashHex(zeroExOrder); + orderHash = getOrderHashHex(zeroExOrder); const exchangeContractAddr = this.props.blockchain.getExchangeContractAddressIfExists(); const signature = parsedOrder.signedOrder.ecSignature; - const isValidSignature = ZeroEx.isValidSignature(orderHash, signature, parsedOrder.signedOrder.maker); + const isSignatureValid = isValidSignature(orderHash, signature, parsedOrder.signedOrder.maker); if (exchangeContractAddr !== parsedOrder.signedOrder.exchangeContractAddress) { orderJSONErrMsg = 'This order was made on another network or using a deprecated Exchange contract'; parsedOrder = undefined; - } else if (!isValidSignature) { + } else if (!isSignatureValid) { orderJSONErrMsg = 'Order signature is invalid'; parsedOrder = undefined; } else { @@ -600,7 +602,7 @@ export class FillOrder extends React.Component { const takerTokenAmount = new BigNumber(parsedOrder.signedOrder.takerTokenAmount); const signedOrder = this.props.blockchain.portalOrderToZeroExOrder(parsedOrder); - const orderHash = ZeroEx.getOrderHashHex(signedOrder); + const orderHash = getOrderHashHex(signedOrder); const unavailableTakerAmount = await this.props.blockchain.getUnavailableTakerAmountAsync(orderHash); const availableTakerTokenAmount = takerTokenAmount.minus(unavailableTakerAmount); try { @@ -646,7 +648,7 @@ export class FillOrder extends React.Component { } } private _formatCurrencyAmount(amount: BigNumber, decimals: number): number { - const unitAmount = ZeroEx.toUnitAmount(amount, decimals); + const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals); const roundedUnitAmount = Math.round(unitAmount.toNumber() * 100000) / 100000; return roundedUnitAmount; } diff --git a/packages/website/ts/components/fill_order_json.tsx b/packages/website/ts/components/fill_order_json.tsx index 97297d5a1..90eedbb18 100644 --- a/packages/website/ts/components/fill_order_json.tsx +++ b/packages/website/ts/components/fill_order_json.tsx @@ -1,4 +1,4 @@ -import { ZeroEx } from '0x.js'; +import { generatePseudoRandomSalt } from '@0xproject/order-utils'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import Paper from 'material-ui/Paper'; @@ -38,7 +38,7 @@ export class FillOrderJSON extends React.Component ); - const amountInUnits = ZeroEx.toUnitAmount(this.props.amountInBaseUnits, this.props.token.decimals); + const amountInUnits = Web3Wrapper.toUnitAmount(this.props.amountInBaseUnits, this.props.token.decimals); const truncatedAddress = utils.getAddressBeginAndEnd(this.props.toAddress); return (
diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx index d46c29058..5f968a5e4 100644 --- a/packages/website/ts/components/generate_order/generate_order_form.tsx +++ b/packages/website/ts/components/generate_order/generate_order_form.tsx @@ -1,5 +1,6 @@ -import { ECSignature, Order, ZeroEx } from '0x.js'; +import { generatePseudoRandomSalt, getOrderHashHex } from '@0xproject/order-utils'; import { colors, constants as sharedConstants } from '@0xproject/react-shared'; +import { ECSignature, Order } from '@0xproject/types'; import { BigNumber, logUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import Dialog from 'material-ui/Dialog'; @@ -78,7 +79,7 @@ export class GenerateOrderForm extends React.Component

Generate an order

@@ -224,7 +225,7 @@ export class GenerateOrderForm extends React.Component @@ -61,7 +61,7 @@ export class EthAmountInput extends React.Component { takerTokenAddress: hashData.receiveTokenContractAddr, takerTokenAmount: hashData.receiveAmount, }; - const orderHash = ZeroEx.getOrderHashHex(order); + const orderHash = getOrderHashHex(order); return orderHash; } } diff --git a/packages/website/ts/components/inputs/token_amount_input.tsx b/packages/website/ts/components/inputs/token_amount_input.tsx index f040928f1..a67120320 100644 --- a/packages/website/ts/components/inputs/token_amount_input.tsx +++ b/packages/website/ts/components/inputs/token_amount_input.tsx @@ -1,6 +1,6 @@ -import { ZeroEx } from '0x.js'; import { colors } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import * as React from 'react'; import { Link } from 'react-router-dom'; @@ -75,14 +75,14 @@ export class TokenAmountInput extends React.Component \ Toggling sets an allowance for the
\ smart contract so you can start trading that token.'; - const userEtherBalanceInEth = ZeroEx.toUnitAmount( + const userEtherBalanceInEth = Web3Wrapper.toUnitAmount( this.props.userEtherBalanceInWei, constants.DECIMAL_PLACES_ETH, ); @@ -445,7 +445,7 @@ export class TokenBalances extends React.Component {unitAmount.toFixed(configs.AMOUNT_DISPLAY_PRECSION)} {symbol} diff --git a/packages/website/ts/components/visual_order.tsx b/packages/website/ts/components/visual_order.tsx index 76a283547..a8d18006e 100644 --- a/packages/website/ts/components/visual_order.tsx +++ b/packages/website/ts/components/visual_order.tsx @@ -1,4 +1,4 @@ -import { ZeroEx } from '0x.js'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import * as React from 'react'; import { Party } from 'ts/components/ui/party'; @@ -63,7 +63,7 @@ export class VisualOrder extends React.Component {unitAmount.toNumber().toFixed(configs.AMOUNT_DISPLAY_PRECSION)} {token.symbol} diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index dab8b7d2f..afcf3862f 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { constants as sharedConstants, EtherscanLinkSuffixes, @@ -6,6 +5,7 @@ import { utils as sharedUtils, } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import FlatButton from 'material-ui/FlatButton'; import FloatingActionButton from 'material-ui/FloatingActionButton'; @@ -473,7 +473,7 @@ export class Wallet extends React.Component { ); } private _renderAmount(amount: BigNumber, decimals: number, symbol: string): React.ReactNode { - const unitAmount = ZeroEx.toUnitAmount(amount, decimals); + const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals); const formattedAmount = unitAmount.toPrecision(TOKEN_AMOUNT_DISPLAY_PRECISION); const result = `${formattedAmount} ${symbol}`; return
{result}
; @@ -482,7 +482,7 @@ export class Wallet extends React.Component { if (_.isUndefined(price)) { return null; } - const unitAmount = ZeroEx.toUnitAmount(amount, decimals); + const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals); const value = unitAmount.mul(price); const formattedAmount = value.toFixed(USD_DECIMAL_PLACES); const result = `$${formattedAmount}`; diff --git a/packages/website/ts/components/wallet/wrap_ether_item.tsx b/packages/website/ts/components/wallet/wrap_ether_item.tsx index 98b28b3ad..0a0a8a1fe 100644 --- a/packages/website/ts/components/wallet/wrap_ether_item.tsx +++ b/packages/website/ts/components/wallet/wrap_ether_item.tsx @@ -1,6 +1,6 @@ -import { ZeroEx } from '0x.js'; import { Styles } from '@0xproject/react-shared'; import { BigNumber, logUtils } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import FlatButton from 'material-ui/FlatButton'; import { ListItem } from 'material-ui/List'; @@ -82,7 +82,10 @@ export class WrapEtherItem extends React.Component Date: Tue, 22 May 2018 18:12:23 -0700 Subject: Fix prettier --- packages/sol-compiler/src/cli.ts | 4 +--- packages/website/ts/components/top_bar/provider_display.tsx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts index d107e8b37..71bb80c7d 100644 --- a/packages/sol-compiler/src/cli.ts +++ b/packages/sol-compiler/src/cli.ts @@ -32,9 +32,7 @@ const SEPARATOR = ','; .help().argv; const contracts = _.isUndefined(argv.contracts) ? undefined - : argv.contracts === DEFAULT_CONTRACTS_LIST - ? DEFAULT_CONTRACTS_LIST - : argv.contracts.split(SEPARATOR); + : argv.contracts === DEFAULT_CONTRACTS_LIST ? DEFAULT_CONTRACTS_LIST : argv.contracts.split(SEPARATOR); const opts: CompilerOptions = { contractsDir: argv.contractsDir, artifactsDir: argv.artifactsDir, diff --git a/packages/website/ts/components/top_bar/provider_display.tsx b/packages/website/ts/components/top_bar/provider_display.tsx index fc516882a..889038652 100644 --- a/packages/website/ts/components/top_bar/provider_display.tsx +++ b/packages/website/ts/components/top_bar/provider_display.tsx @@ -43,9 +43,7 @@ export class ProviderDisplay extends React.Component Date: Wed, 23 May 2018 09:57:43 -0700 Subject: Fix NameResolver --- packages/sol-resolver/src/resolvers/name_resolver.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/sol-resolver/src/resolvers/name_resolver.ts b/packages/sol-resolver/src/resolvers/name_resolver.ts index 586fad86a..e489c70a7 100644 --- a/packages/sol-resolver/src/resolvers/name_resolver.ts +++ b/packages/sol-resolver/src/resolvers/name_resolver.ts @@ -56,13 +56,15 @@ export class NameResolver extends EnumerableResolver { throw new Error(`No directory found at ${dirPath}`); } for (const fileName of dirContents) { - if (!fileName.endsWith(SOLIDITY_FILE_EXTENSION)) { - continue; - } const absoluteEntryPath = path.join(dirPath, fileName); const isDirectory = fs.lstatSync(absoluteEntryPath).isDirectory(); const entryPath = path.relative(this._contractsDir, absoluteEntryPath); - const isComplete = isDirectory ? this._traverseContractsDir(absoluteEntryPath, onFile) : onFile(entryPath); + let isComplete; + if (isDirectory) { + isComplete = this._traverseContractsDir(absoluteEntryPath, onFile); + } else if (fileName.endsWith(SOLIDITY_FILE_EXTENSION)) { + isComplete = onFile(entryPath); + } if (isComplete) { return isComplete; } -- cgit v1.2.3 From 65f09d052831e7722f62478db6026ebb855c7f2c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 23 May 2018 10:15:03 -0700 Subject: Fix prettier --- packages/sol-compiler/src/cli.ts | 4 +++- packages/website/ts/blockchain.ts | 4 +++- packages/website/ts/components/top_bar/provider_display.tsx | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts index 71bb80c7d..d107e8b37 100644 --- a/packages/sol-compiler/src/cli.ts +++ b/packages/sol-compiler/src/cli.ts @@ -32,7 +32,9 @@ const SEPARATOR = ','; .help().argv; const contracts = _.isUndefined(argv.contracts) ? undefined - : argv.contracts === DEFAULT_CONTRACTS_LIST ? DEFAULT_CONTRACTS_LIST : argv.contracts.split(SEPARATOR); + : argv.contracts === DEFAULT_CONTRACTS_LIST + ? DEFAULT_CONTRACTS_LIST + : argv.contracts.split(SEPARATOR); const opts: CompilerOptions = { contractsDir: argv.contractsDir, artifactsDir: argv.artifactsDir, diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 17dbee5c8..d18f3b398 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -791,7 +791,9 @@ export class Blockchain { const provider = await Blockchain._getProviderAsync(injectedWeb3, networkIdIfExists); this.networkId = !_.isUndefined(networkIdIfExists) ? networkIdIfExists - : configs.IS_MAINNET_ENABLED ? constants.NETWORK_ID_MAINNET : constants.NETWORK_ID_KOVAN; + : configs.IS_MAINNET_ENABLED + ? constants.NETWORK_ID_MAINNET + : constants.NETWORK_ID_KOVAN; this._dispatcher.updateNetworkId(this.networkId); const zeroExConfigs = { networkId: this.networkId, diff --git a/packages/website/ts/components/top_bar/provider_display.tsx b/packages/website/ts/components/top_bar/provider_display.tsx index 889038652..fc516882a 100644 --- a/packages/website/ts/components/top_bar/provider_display.tsx +++ b/packages/website/ts/components/top_bar/provider_display.tsx @@ -43,7 +43,9 @@ export class ProviderDisplay extends React.Component Date: Wed, 23 May 2018 10:32:14 -0700 Subject: Move contract utils --- packages/contracts/package.json | 2 +- packages/contracts/src/utils/coverage.ts | 21 ++ packages/contracts/src/utils/match_order_tester.ts | 356 +++++++++++++++++++++ packages/contracts/test/exchange/match_orders.ts | 2 +- packages/contracts/test/global_hooks.ts | 2 +- packages/contracts/test/utils/coverage.ts | 21 -- .../contracts/test/utils/match_order_tester.ts | 356 --------------------- 7 files changed, 380 insertions(+), 380 deletions(-) create mode 100644 packages/contracts/src/utils/coverage.ts create mode 100644 packages/contracts/src/utils/match_order_tester.ts delete mode 100644 packages/contracts/test/utils/coverage.ts delete mode 100644 packages/contracts/test/utils/match_order_tester.ts diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 766280fc9..1c66a3b86 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -45,7 +45,7 @@ "@0xproject/dev-utils": "^0.4.2", "@0xproject/tslint-config": "^0.4.18", "@0xproject/subproviders": "^0.10.1", - "@0xproject/sol-cov": "^0.0.10", + "@0xproject/sol-cov": "^0.0.11", "@types/lodash": "4.14.104", "@types/node": "^8.0.53", "@types/yargs": "^10.0.0", diff --git a/packages/contracts/src/utils/coverage.ts b/packages/contracts/src/utils/coverage.ts new file mode 100644 index 000000000..a37939464 --- /dev/null +++ b/packages/contracts/src/utils/coverage.ts @@ -0,0 +1,21 @@ +import { devConstants } from '@0xproject/dev-utils'; +import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov'; +import * as fs from 'fs'; +import * as _ from 'lodash'; + +let coverageSubprovider: CoverageSubprovider; + +export const coverage = { + getCoverageSubproviderSingleton(): CoverageSubprovider { + if (_.isUndefined(coverageSubprovider)) { + coverageSubprovider = coverage._getCoverageSubprovider(); + } + return coverageSubprovider; + }, + _getCoverageSubprovider(): CoverageSubprovider { + const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; + const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(); + const subprovider = new CoverageSubprovider(solCompilerArtifactAdapter, defaultFromAddress); + return subprovider; + }, +}; diff --git a/packages/contracts/src/utils/match_order_tester.ts b/packages/contracts/src/utils/match_order_tester.ts new file mode 100644 index 000000000..30039937f --- /dev/null +++ b/packages/contracts/src/utils/match_order_tester.ts @@ -0,0 +1,356 @@ +import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import { LogWithDecodedArgs } from '@0xproject/types'; +import { BigNumber } from '@0xproject/utils'; +import * as chai from 'chai'; +import ethUtil = require('ethereumjs-util'); +import * as _ from 'lodash'; + +import { DummyERC20TokenContract } from '../contract_wrappers/generated/dummy_e_r_c20_token'; +import { DummyERC721TokenContract } from '../contract_wrappers/generated/dummy_e_r_c721_token'; +import { ERC20ProxyContract } from '../contract_wrappers/generated/e_r_c20_proxy'; +import { ERC721ProxyContract } from '../contract_wrappers/generated/e_r_c721_proxy'; +import { + CancelContractEventArgs, + ExchangeContract, + FillContractEventArgs, +} from '../contract_wrappers/generated/exchange'; +import { assetProxyUtils } from '../utils/asset_proxy_utils'; +import { chaiSetup } from '../utils/chai_setup'; +import { constants } from '../utils/constants'; +import { crypto } from '../utils/crypto'; +import { ERC20Wrapper } from '../utils/erc20_wrapper'; +import { ERC721Wrapper } from '../utils/erc721_wrapper'; +import { ExchangeWrapper } from '../utils/exchange_wrapper'; +import { OrderFactory } from '../utils/order_factory'; +import { orderUtils } from '../utils/order_utils'; +import { + AssetProxyId, + ContractName, + ERC20BalancesByOwner, + ERC721TokenIdsByOwner, + ExchangeStatus, + SignedOrder, + TransferAmountsByMatchOrders as TransferAmounts, +} from '../utils/types'; +import { provider, web3Wrapper } from '../utils/web3_wrapper'; + +chaiSetup.configure(); +const expect = chai.expect; +const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); + +export class MatchOrderTester { + private _exchangeWrapper: ExchangeWrapper; + private _erc20Wrapper: ERC20Wrapper; + private _erc721Wrapper: ERC721Wrapper; + private _feeTokenAddress: string; + + /// @dev Compares a pair of ERC20 balances and a pair of ERC721 token owners. + /// @param expectedNewERC20BalancesByOwner Expected ERC20 balances. + /// @param realERC20BalancesByOwner Actual ERC20 balances. + /// @param expectedNewERC721TokenIdsByOwner Expected ERC721 token owners. + /// @param realERC721TokenIdsByOwner Actual ERC20 token owners. + /// @return True only if ERC20 balances match and ERC721 token owners match. + private static _compareExpectedAndRealBalances( + expectedNewERC20BalancesByOwner: ERC20BalancesByOwner, + realERC20BalancesByOwner: ERC20BalancesByOwner, + expectedNewERC721TokenIdsByOwner: ERC721TokenIdsByOwner, + realERC721TokenIdsByOwner: ERC721TokenIdsByOwner, + ): boolean { + // ERC20 Balances + const doesErc20BalancesMatch = _.isEqual(expectedNewERC20BalancesByOwner, realERC20BalancesByOwner); + if (!doesErc20BalancesMatch) { + return false; + } + // ERC721 Token Ids + const sortedExpectedNewERC721TokenIdsByOwner = _.mapValues( + expectedNewERC721TokenIdsByOwner, + tokenIdsByOwner => { + _.mapValues(tokenIdsByOwner, tokenIds => { + _.sortBy(tokenIds); + }); + }, + ); + const sortedNewERC721TokenIdsByOwner = _.mapValues(realERC721TokenIdsByOwner, tokenIdsByOwner => { + _.mapValues(tokenIdsByOwner, tokenIds => { + _.sortBy(tokenIds); + }); + }); + const doesErc721TokenIdsMatch = _.isEqual( + sortedExpectedNewERC721TokenIdsByOwner, + sortedNewERC721TokenIdsByOwner, + ); + return doesErc721TokenIdsMatch; + } + /// @dev Constructs new MatchOrderTester. + /// @param exchangeWrapper Used to call to the Exchange. + /// @param erc20Wrapper Used to fetch ERC20 balances. + /// @param erc721Wrapper Used to fetch ERC721 token owners. + /// @param feeTokenAddress Address of ERC20 fee token. + constructor( + exchangeWrapper: ExchangeWrapper, + erc20Wrapper: ERC20Wrapper, + erc721Wrapper: ERC721Wrapper, + feeTokenAddress: string, + ) { + this._exchangeWrapper = exchangeWrapper; + this._erc20Wrapper = erc20Wrapper; + this._erc721Wrapper = erc721Wrapper; + this._feeTokenAddress = feeTokenAddress; + } + /// @dev Matches two complementary orders and validates results. + /// Validation either succeeds or throws. + /// @param signedOrderLeft First matched order. + /// @param signedOrderRight Second matched order. + /// @param takerAddress Address of taker (the address who matched the two orders) + /// @param erc20BalancesByOwner Current ERC20 balances. + /// @param erc721TokenIdsByOwner Current ERC721 token owners. + /// @param initialTakerAssetFilledAmountLeft Current amount the left order has been filled. + /// @param initialTakerAssetFilledAmountRight Current amount the right order has been filled. + /// @return New ERC20 balances & ERC721 token owners. + public async matchOrdersAndVerifyBalancesAsync( + signedOrderLeft: SignedOrder, + signedOrderRight: SignedOrder, + takerAddress: string, + erc20BalancesByOwner: ERC20BalancesByOwner, + erc721TokenIdsByOwner: ERC721TokenIdsByOwner, + initialTakerAssetFilledAmountLeft?: BigNumber, + initialTakerAssetFilledAmountRight?: BigNumber, + ): Promise<[ERC20BalancesByOwner, ERC721TokenIdsByOwner]> { + // Test setup & verify preconditions + const makerAddressLeft = signedOrderLeft.makerAddress; + const makerAddressRight = signedOrderRight.makerAddress; + const feeRecipientAddressLeft = signedOrderLeft.feeRecipientAddress; + const feeRecipientAddressRight = signedOrderRight.feeRecipientAddress; + // Verify Left order preconditions + const orderTakerAssetFilledAmountLeft = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( + orderUtils.getOrderHashHex(signedOrderLeft), + ); + const expectedOrderFilledAmountLeft = initialTakerAssetFilledAmountLeft + ? initialTakerAssetFilledAmountLeft + : new BigNumber(0); + expect(expectedOrderFilledAmountLeft).to.be.bignumber.equal(orderTakerAssetFilledAmountLeft); + // Verify Right order preconditions + const orderTakerAssetFilledAmountRight = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( + orderUtils.getOrderHashHex(signedOrderRight), + ); + const expectedOrderFilledAmountRight = initialTakerAssetFilledAmountRight + ? initialTakerAssetFilledAmountRight + : new BigNumber(0); + expect(expectedOrderFilledAmountRight).to.be.bignumber.equal(orderTakerAssetFilledAmountRight); + // Match left & right orders + await this._exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress); + const newERC20BalancesByOwner = await this._erc20Wrapper.getBalancesAsync(); + const newERC721TokenIdsByOwner = await this._erc721Wrapper.getBalancesAsync(); + // Calculate expected balance changes + const expectedTransferAmounts = await this._calculateExpectedTransferAmountsAsync( + signedOrderLeft, + signedOrderRight, + orderTakerAssetFilledAmountLeft, + orderTakerAssetFilledAmountRight, + ); + let expectedERC20BalancesByOwner: ERC20BalancesByOwner; + let expectedERC721TokenIdsByOwner: ERC721TokenIdsByOwner; + [expectedERC20BalancesByOwner, expectedERC721TokenIdsByOwner] = this._calculateExpectedBalances( + signedOrderLeft, + signedOrderRight, + takerAddress, + erc20BalancesByOwner, + erc721TokenIdsByOwner, + expectedTransferAmounts, + ); + // Assert our expected balances are equal to the actual balances + const didExpectedBalancesMatchRealBalances = MatchOrderTester._compareExpectedAndRealBalances( + expectedERC20BalancesByOwner, + newERC20BalancesByOwner, + expectedERC721TokenIdsByOwner, + newERC721TokenIdsByOwner, + ); + expect(didExpectedBalancesMatchRealBalances).to.be.true(); + return [newERC20BalancesByOwner, newERC721TokenIdsByOwner]; + } + /// @dev Calculates expected transfer amounts between order makers, fee recipients, and + /// the taker when two orders are matched. + /// @param signedOrderLeft First matched order. + /// @param signedOrderRight Second matched order. + /// @param orderTakerAssetFilledAmountLeft How much left order has been filled, prior to matching orders. + /// @param orderTakerAssetFilledAmountRight How much the right order has been filled, prior to matching orders. + /// @return TransferAmounts A struct containing the expected transfer amounts. + private async _calculateExpectedTransferAmountsAsync( + signedOrderLeft: SignedOrder, + signedOrderRight: SignedOrder, + orderTakerAssetFilledAmountLeft: BigNumber, + orderTakerAssetFilledAmountRight: BigNumber, + ): Promise { + let amountBoughtByLeftMaker = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( + orderUtils.getOrderHashHex(signedOrderLeft), + ); + amountBoughtByLeftMaker = amountBoughtByLeftMaker.minus(orderTakerAssetFilledAmountLeft); + const amountSoldByLeftMaker = amountBoughtByLeftMaker + .times(signedOrderLeft.makerAssetAmount) + .dividedToIntegerBy(signedOrderLeft.takerAssetAmount); + const amountReceivedByRightMaker = amountBoughtByLeftMaker + .times(signedOrderRight.takerAssetAmount) + .dividedToIntegerBy(signedOrderRight.makerAssetAmount); + const amountReceivedByTaker = amountSoldByLeftMaker.minus(amountReceivedByRightMaker); + let amountBoughtByRightMaker = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( + orderUtils.getOrderHashHex(signedOrderRight), + ); + amountBoughtByRightMaker = amountBoughtByRightMaker.minus(orderTakerAssetFilledAmountRight); + const amountSoldByRightMaker = amountBoughtByRightMaker + .times(signedOrderRight.makerAssetAmount) + .dividedToIntegerBy(signedOrderRight.takerAssetAmount); + const amountReceivedByLeftMaker = amountSoldByRightMaker; + const feePaidByLeftMaker = signedOrderLeft.makerFee + .times(amountSoldByLeftMaker) + .dividedToIntegerBy(signedOrderLeft.makerAssetAmount); + const feePaidByRightMaker = signedOrderRight.makerFee + .times(amountSoldByRightMaker) + .dividedToIntegerBy(signedOrderRight.makerAssetAmount); + const feePaidByTakerLeft = signedOrderLeft.takerFee + .times(amountSoldByLeftMaker) + .dividedToIntegerBy(signedOrderLeft.makerAssetAmount); + const feePaidByTakerRight = signedOrderRight.takerFee + .times(amountSoldByRightMaker) + .dividedToIntegerBy(signedOrderRight.makerAssetAmount); + const totalFeePaidByTaker = feePaidByTakerLeft.add(feePaidByTakerRight); + const feeReceivedLeft = feePaidByLeftMaker.add(feePaidByTakerLeft); + const feeReceivedRight = feePaidByRightMaker.add(feePaidByTakerRight); + // Return values + const expectedTransferAmounts = { + // Left Maker + amountBoughtByLeftMaker, + amountSoldByLeftMaker, + amountReceivedByLeftMaker, + feePaidByLeftMaker, + // Right Maker + amountBoughtByRightMaker, + amountSoldByRightMaker, + amountReceivedByRightMaker, + feePaidByRightMaker, + // Taker + amountReceivedByTaker, + feePaidByTakerLeft, + feePaidByTakerRight, + totalFeePaidByTaker, + // Fee Recipients + feeReceivedLeft, + feeReceivedRight, + }; + return expectedTransferAmounts; + } + /// @dev Calculates the expected balances of order makers, fee recipients, and the taker, + /// as a result of matching two orders. + /// @param signedOrderLeft First matched order. + /// @param signedOrderRight Second matched order. + /// @param takerAddress Address of taker (the address who matched the two orders) + /// @param erc20BalancesByOwner Current ERC20 balances. + /// @param erc721TokenIdsByOwner Current ERC721 token owners. + /// @param expectedTransferAmounts A struct containing the expected transfer amounts. + /// @return Expected ERC20 balances & ERC721 token owners after orders have been matched. + private _calculateExpectedBalances( + signedOrderLeft: SignedOrder, + signedOrderRight: SignedOrder, + takerAddress: string, + erc20BalancesByOwner: ERC20BalancesByOwner, + erc721TokenIdsByOwner: ERC721TokenIdsByOwner, + expectedTransferAmounts: TransferAmounts, + ): [ERC20BalancesByOwner, ERC721TokenIdsByOwner] { + const makerAddressLeft = signedOrderLeft.makerAddress; + const makerAddressRight = signedOrderRight.makerAddress; + const feeRecipientAddressLeft = signedOrderLeft.feeRecipientAddress; + const feeRecipientAddressRight = signedOrderRight.feeRecipientAddress; + // Operations are performed on copies of the balances + const expectedNewERC20BalancesByOwner = _.cloneDeep(erc20BalancesByOwner); + const expectedNewERC721TokenIdsByOwner = _.cloneDeep(erc721TokenIdsByOwner); + // Left Maker Asset (Right Taker Asset) + const makerAssetProxyIdLeft = assetProxyUtils.decodeProxyDataId(signedOrderLeft.makerAssetData); + if (makerAssetProxyIdLeft === AssetProxyId.ERC20) { + // Decode asset data + const erc20ProxyData = assetProxyUtils.decodeERC20ProxyData(signedOrderLeft.makerAssetData); + const makerAssetAddressLeft = erc20ProxyData.tokenAddress; + const takerAssetAddressRight = makerAssetAddressLeft; + // Left Maker + expectedNewERC20BalancesByOwner[makerAddressLeft][makerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ + makerAddressLeft + ][makerAssetAddressLeft].minus(expectedTransferAmounts.amountSoldByLeftMaker); + // Right Maker + expectedNewERC20BalancesByOwner[makerAddressRight][ + takerAssetAddressRight + ] = expectedNewERC20BalancesByOwner[makerAddressRight][takerAssetAddressRight].add( + expectedTransferAmounts.amountReceivedByRightMaker, + ); + // Taker + expectedNewERC20BalancesByOwner[takerAddress][makerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ + takerAddress + ][makerAssetAddressLeft].add(expectedTransferAmounts.amountReceivedByTaker); + } else if (makerAssetProxyIdLeft === AssetProxyId.ERC721) { + // Decode asset data + const erc721ProxyData = assetProxyUtils.decodeERC721ProxyData(signedOrderLeft.makerAssetData); + const makerAssetAddressLeft = erc721ProxyData.tokenAddress; + const makerAssetIdLeft = erc721ProxyData.tokenId; + const takerAssetAddressRight = makerAssetAddressLeft; + const takerAssetIdRight = makerAssetIdLeft; + // Left Maker + _.remove(expectedNewERC721TokenIdsByOwner[makerAddressLeft][makerAssetAddressLeft], makerAssetIdLeft); + // Right Maker + expectedNewERC721TokenIdsByOwner[makerAddressRight][takerAssetAddressRight].push(takerAssetIdRight); + // Taker: Since there is only 1 asset transferred, the taker does not receive any of the left maker asset. + } + // Left Taker Asset (Right Maker Asset) + // Note: This exchange is only between the order makers: the Taker does not receive any of the left taker asset. + const takerAssetProxyIdLeft = assetProxyUtils.decodeProxyDataId(signedOrderLeft.takerAssetData); + if (takerAssetProxyIdLeft === AssetProxyId.ERC20) { + // Decode asset data + const erc20ProxyData = assetProxyUtils.decodeERC20ProxyData(signedOrderLeft.takerAssetData); + const takerAssetAddressLeft = erc20ProxyData.tokenAddress; + const makerAssetAddressRight = takerAssetAddressLeft; + // Left Maker + expectedNewERC20BalancesByOwner[makerAddressLeft][takerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ + makerAddressLeft + ][takerAssetAddressLeft].add(expectedTransferAmounts.amountReceivedByLeftMaker); + // Right Maker + expectedNewERC20BalancesByOwner[makerAddressRight][ + makerAssetAddressRight + ] = expectedNewERC20BalancesByOwner[makerAddressRight][makerAssetAddressRight].minus( + expectedTransferAmounts.amountSoldByRightMaker, + ); + } else if (takerAssetProxyIdLeft === AssetProxyId.ERC721) { + // Decode asset data + const erc721ProxyData = assetProxyUtils.decodeERC721ProxyData(signedOrderRight.makerAssetData); + const makerAssetAddressRight = erc721ProxyData.tokenAddress; + const makerAssetIdRight = erc721ProxyData.tokenId; + const takerAssetAddressLeft = makerAssetAddressRight; + const takerAssetIdLeft = makerAssetIdRight; + // Right Maker + _.remove(expectedNewERC721TokenIdsByOwner[makerAddressRight][makerAssetAddressRight], makerAssetIdRight); + // Left Maker + expectedNewERC721TokenIdsByOwner[makerAddressLeft][takerAssetAddressLeft].push(takerAssetIdLeft); + } + // Left Maker Fees + expectedNewERC20BalancesByOwner[makerAddressLeft][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ + makerAddressLeft + ][this._feeTokenAddress].minus(expectedTransferAmounts.feePaidByLeftMaker); + // Right Maker Fees + expectedNewERC20BalancesByOwner[makerAddressRight][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ + makerAddressRight + ][this._feeTokenAddress].minus(expectedTransferAmounts.feePaidByRightMaker); + // Taker Fees + expectedNewERC20BalancesByOwner[takerAddress][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ + takerAddress + ][this._feeTokenAddress].minus(expectedTransferAmounts.totalFeePaidByTaker); + // Left Fee Recipient Fees + expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][ + this._feeTokenAddress + ] = expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][this._feeTokenAddress].add( + expectedTransferAmounts.feeReceivedLeft, + ); + // Right Fee Recipient Fees + expectedNewERC20BalancesByOwner[feeRecipientAddressRight][ + this._feeTokenAddress + ] = expectedNewERC20BalancesByOwner[feeRecipientAddressRight][this._feeTokenAddress].add( + expectedTransferAmounts.feeReceivedRight, + ); + + return [expectedNewERC20BalancesByOwner, expectedNewERC721TokenIdsByOwner]; + } +} diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index e732c90db..8a3c91520 100644 --- a/packages/contracts/test/exchange/match_orders.ts +++ b/packages/contracts/test/exchange/match_orders.ts @@ -37,7 +37,7 @@ import { } from '../../src/utils/types'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; -import { MatchOrderTester } from '../utils/match_order_tester'; +import { MatchOrderTester } from '../../src/utils/match_order_tester'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/contracts/test/global_hooks.ts b/packages/contracts/test/global_hooks.ts index 509dc6837..8b48b030d 100644 --- a/packages/contracts/test/global_hooks.ts +++ b/packages/contracts/test/global_hooks.ts @@ -1,6 +1,6 @@ import { env, EnvVars } from '@0xproject/dev-utils'; -import { coverage } from './utils/coverage'; +import { coverage } from '../src/utils/coverage'; after('generate coverage report', async () => { if (env.parseBoolean(EnvVars.SolidityCoverage)) { diff --git a/packages/contracts/test/utils/coverage.ts b/packages/contracts/test/utils/coverage.ts deleted file mode 100644 index a37939464..000000000 --- a/packages/contracts/test/utils/coverage.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { devConstants } from '@0xproject/dev-utils'; -import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov'; -import * as fs from 'fs'; -import * as _ from 'lodash'; - -let coverageSubprovider: CoverageSubprovider; - -export const coverage = { - getCoverageSubproviderSingleton(): CoverageSubprovider { - if (_.isUndefined(coverageSubprovider)) { - coverageSubprovider = coverage._getCoverageSubprovider(); - } - return coverageSubprovider; - }, - _getCoverageSubprovider(): CoverageSubprovider { - const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - const solCompilerArtifactAdapter = new SolCompilerArtifactAdapter(); - const subprovider = new CoverageSubprovider(solCompilerArtifactAdapter, defaultFromAddress); - return subprovider; - }, -}; diff --git a/packages/contracts/test/utils/match_order_tester.ts b/packages/contracts/test/utils/match_order_tester.ts deleted file mode 100644 index 43196728c..000000000 --- a/packages/contracts/test/utils/match_order_tester.ts +++ /dev/null @@ -1,356 +0,0 @@ -import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { LogWithDecodedArgs } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; -import * as chai from 'chai'; -import ethUtil = require('ethereumjs-util'); -import * as _ from 'lodash'; - -import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; -import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c721_token'; -import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; -import { ERC721ProxyContract } from '../../src/contract_wrappers/generated/e_r_c721_proxy'; -import { - CancelContractEventArgs, - ExchangeContract, - FillContractEventArgs, -} from '../../src/contract_wrappers/generated/exchange'; -import { assetProxyUtils } from '../../src/utils/asset_proxy_utils'; -import { chaiSetup } from '../../src/utils/chai_setup'; -import { constants } from '../../src/utils/constants'; -import { crypto } from '../../src/utils/crypto'; -import { ERC20Wrapper } from '../../src/utils/erc20_wrapper'; -import { ERC721Wrapper } from '../../src/utils/erc721_wrapper'; -import { ExchangeWrapper } from '../../src/utils/exchange_wrapper'; -import { OrderFactory } from '../../src/utils/order_factory'; -import { orderUtils } from '../../src/utils/order_utils'; -import { - AssetProxyId, - ContractName, - ERC20BalancesByOwner, - ERC721TokenIdsByOwner, - ExchangeStatus, - SignedOrder, - TransferAmountsByMatchOrders as TransferAmounts, -} from '../../src/utils/types'; -import { provider, web3Wrapper } from '../../src/utils/web3_wrapper'; - -chaiSetup.configure(); -const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); - -export class MatchOrderTester { - private _exchangeWrapper: ExchangeWrapper; - private _erc20Wrapper: ERC20Wrapper; - private _erc721Wrapper: ERC721Wrapper; - private _feeTokenAddress: string; - - /// @dev Compares a pair of ERC20 balances and a pair of ERC721 token owners. - /// @param expectedNewERC20BalancesByOwner Expected ERC20 balances. - /// @param realERC20BalancesByOwner Actual ERC20 balances. - /// @param expectedNewERC721TokenIdsByOwner Expected ERC721 token owners. - /// @param realERC721TokenIdsByOwner Actual ERC20 token owners. - /// @return True only if ERC20 balances match and ERC721 token owners match. - private static _compareExpectedAndRealBalances( - expectedNewERC20BalancesByOwner: ERC20BalancesByOwner, - realERC20BalancesByOwner: ERC20BalancesByOwner, - expectedNewERC721TokenIdsByOwner: ERC721TokenIdsByOwner, - realERC721TokenIdsByOwner: ERC721TokenIdsByOwner, - ): boolean { - // ERC20 Balances - const doesErc20BalancesMatch = _.isEqual(expectedNewERC20BalancesByOwner, realERC20BalancesByOwner); - if (!doesErc20BalancesMatch) { - return false; - } - // ERC721 Token Ids - const sortedExpectedNewERC721TokenIdsByOwner = _.mapValues( - expectedNewERC721TokenIdsByOwner, - tokenIdsByOwner => { - _.mapValues(tokenIdsByOwner, tokenIds => { - _.sortBy(tokenIds); - }); - }, - ); - const sortedNewERC721TokenIdsByOwner = _.mapValues(realERC721TokenIdsByOwner, tokenIdsByOwner => { - _.mapValues(tokenIdsByOwner, tokenIds => { - _.sortBy(tokenIds); - }); - }); - const doesErc721TokenIdsMatch = _.isEqual( - sortedExpectedNewERC721TokenIdsByOwner, - sortedNewERC721TokenIdsByOwner, - ); - return doesErc721TokenIdsMatch; - } - /// @dev Constructs new MatchOrderTester. - /// @param exchangeWrapper Used to call to the Exchange. - /// @param erc20Wrapper Used to fetch ERC20 balances. - /// @param erc721Wrapper Used to fetch ERC721 token owners. - /// @param feeTokenAddress Address of ERC20 fee token. - constructor( - exchangeWrapper: ExchangeWrapper, - erc20Wrapper: ERC20Wrapper, - erc721Wrapper: ERC721Wrapper, - feeTokenAddress: string, - ) { - this._exchangeWrapper = exchangeWrapper; - this._erc20Wrapper = erc20Wrapper; - this._erc721Wrapper = erc721Wrapper; - this._feeTokenAddress = feeTokenAddress; - } - /// @dev Matches two complementary orders and validates results. - /// Validation either succeeds or throws. - /// @param signedOrderLeft First matched order. - /// @param signedOrderRight Second matched order. - /// @param takerAddress Address of taker (the address who matched the two orders) - /// @param erc20BalancesByOwner Current ERC20 balances. - /// @param erc721TokenIdsByOwner Current ERC721 token owners. - /// @param initialTakerAssetFilledAmountLeft Current amount the left order has been filled. - /// @param initialTakerAssetFilledAmountRight Current amount the right order has been filled. - /// @return New ERC20 balances & ERC721 token owners. - public async matchOrdersAndVerifyBalancesAsync( - signedOrderLeft: SignedOrder, - signedOrderRight: SignedOrder, - takerAddress: string, - erc20BalancesByOwner: ERC20BalancesByOwner, - erc721TokenIdsByOwner: ERC721TokenIdsByOwner, - initialTakerAssetFilledAmountLeft?: BigNumber, - initialTakerAssetFilledAmountRight?: BigNumber, - ): Promise<[ERC20BalancesByOwner, ERC721TokenIdsByOwner]> { - // Test setup & verify preconditions - const makerAddressLeft = signedOrderLeft.makerAddress; - const makerAddressRight = signedOrderRight.makerAddress; - const feeRecipientAddressLeft = signedOrderLeft.feeRecipientAddress; - const feeRecipientAddressRight = signedOrderRight.feeRecipientAddress; - // Verify Left order preconditions - const orderTakerAssetFilledAmountLeft = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( - orderUtils.getOrderHashHex(signedOrderLeft), - ); - const expectedOrderFilledAmountLeft = initialTakerAssetFilledAmountLeft - ? initialTakerAssetFilledAmountLeft - : new BigNumber(0); - expect(expectedOrderFilledAmountLeft).to.be.bignumber.equal(orderTakerAssetFilledAmountLeft); - // Verify Right order preconditions - const orderTakerAssetFilledAmountRight = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( - orderUtils.getOrderHashHex(signedOrderRight), - ); - const expectedOrderFilledAmountRight = initialTakerAssetFilledAmountRight - ? initialTakerAssetFilledAmountRight - : new BigNumber(0); - expect(expectedOrderFilledAmountRight).to.be.bignumber.equal(orderTakerAssetFilledAmountRight); - // Match left & right orders - await this._exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress); - const newERC20BalancesByOwner = await this._erc20Wrapper.getBalancesAsync(); - const newERC721TokenIdsByOwner = await this._erc721Wrapper.getBalancesAsync(); - // Calculate expected balance changes - const expectedTransferAmounts = await this._calculateExpectedTransferAmountsAsync( - signedOrderLeft, - signedOrderRight, - orderTakerAssetFilledAmountLeft, - orderTakerAssetFilledAmountRight, - ); - let expectedERC20BalancesByOwner: ERC20BalancesByOwner; - let expectedERC721TokenIdsByOwner: ERC721TokenIdsByOwner; - [expectedERC20BalancesByOwner, expectedERC721TokenIdsByOwner] = this._calculateExpectedBalances( - signedOrderLeft, - signedOrderRight, - takerAddress, - erc20BalancesByOwner, - erc721TokenIdsByOwner, - expectedTransferAmounts, - ); - // Assert our expected balances are equal to the actual balances - const didExpectedBalancesMatchRealBalances = MatchOrderTester._compareExpectedAndRealBalances( - expectedERC20BalancesByOwner, - newERC20BalancesByOwner, - expectedERC721TokenIdsByOwner, - newERC721TokenIdsByOwner, - ); - expect(didExpectedBalancesMatchRealBalances).to.be.true(); - return [newERC20BalancesByOwner, newERC721TokenIdsByOwner]; - } - /// @dev Calculates expected transfer amounts between order makers, fee recipients, and - /// the taker when two orders are matched. - /// @param signedOrderLeft First matched order. - /// @param signedOrderRight Second matched order. - /// @param orderTakerAssetFilledAmountLeft How much left order has been filled, prior to matching orders. - /// @param orderTakerAssetFilledAmountRight How much the right order has been filled, prior to matching orders. - /// @return TransferAmounts A struct containing the expected transfer amounts. - private async _calculateExpectedTransferAmountsAsync( - signedOrderLeft: SignedOrder, - signedOrderRight: SignedOrder, - orderTakerAssetFilledAmountLeft: BigNumber, - orderTakerAssetFilledAmountRight: BigNumber, - ): Promise { - let amountBoughtByLeftMaker = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( - orderUtils.getOrderHashHex(signedOrderLeft), - ); - amountBoughtByLeftMaker = amountBoughtByLeftMaker.minus(orderTakerAssetFilledAmountLeft); - const amountSoldByLeftMaker = amountBoughtByLeftMaker - .times(signedOrderLeft.makerAssetAmount) - .dividedToIntegerBy(signedOrderLeft.takerAssetAmount); - const amountReceivedByRightMaker = amountBoughtByLeftMaker - .times(signedOrderRight.takerAssetAmount) - .dividedToIntegerBy(signedOrderRight.makerAssetAmount); - const amountReceivedByTaker = amountSoldByLeftMaker.minus(amountReceivedByRightMaker); - let amountBoughtByRightMaker = await this._exchangeWrapper.getTakerAssetFilledAmountAsync( - orderUtils.getOrderHashHex(signedOrderRight), - ); - amountBoughtByRightMaker = amountBoughtByRightMaker.minus(orderTakerAssetFilledAmountRight); - const amountSoldByRightMaker = amountBoughtByRightMaker - .times(signedOrderRight.makerAssetAmount) - .dividedToIntegerBy(signedOrderRight.takerAssetAmount); - const amountReceivedByLeftMaker = amountSoldByRightMaker; - const feePaidByLeftMaker = signedOrderLeft.makerFee - .times(amountSoldByLeftMaker) - .dividedToIntegerBy(signedOrderLeft.makerAssetAmount); - const feePaidByRightMaker = signedOrderRight.makerFee - .times(amountSoldByRightMaker) - .dividedToIntegerBy(signedOrderRight.makerAssetAmount); - const feePaidByTakerLeft = signedOrderLeft.takerFee - .times(amountSoldByLeftMaker) - .dividedToIntegerBy(signedOrderLeft.makerAssetAmount); - const feePaidByTakerRight = signedOrderRight.takerFee - .times(amountSoldByRightMaker) - .dividedToIntegerBy(signedOrderRight.makerAssetAmount); - const totalFeePaidByTaker = feePaidByTakerLeft.add(feePaidByTakerRight); - const feeReceivedLeft = feePaidByLeftMaker.add(feePaidByTakerLeft); - const feeReceivedRight = feePaidByRightMaker.add(feePaidByTakerRight); - // Return values - const expectedTransferAmounts = { - // Left Maker - amountBoughtByLeftMaker, - amountSoldByLeftMaker, - amountReceivedByLeftMaker, - feePaidByLeftMaker, - // Right Maker - amountBoughtByRightMaker, - amountSoldByRightMaker, - amountReceivedByRightMaker, - feePaidByRightMaker, - // Taker - amountReceivedByTaker, - feePaidByTakerLeft, - feePaidByTakerRight, - totalFeePaidByTaker, - // Fee Recipients - feeReceivedLeft, - feeReceivedRight, - }; - return expectedTransferAmounts; - } - /// @dev Calculates the expected balances of order makers, fee recipients, and the taker, - /// as a result of matching two orders. - /// @param signedOrderLeft First matched order. - /// @param signedOrderRight Second matched order. - /// @param takerAddress Address of taker (the address who matched the two orders) - /// @param erc20BalancesByOwner Current ERC20 balances. - /// @param erc721TokenIdsByOwner Current ERC721 token owners. - /// @param expectedTransferAmounts A struct containing the expected transfer amounts. - /// @return Expected ERC20 balances & ERC721 token owners after orders have been matched. - private _calculateExpectedBalances( - signedOrderLeft: SignedOrder, - signedOrderRight: SignedOrder, - takerAddress: string, - erc20BalancesByOwner: ERC20BalancesByOwner, - erc721TokenIdsByOwner: ERC721TokenIdsByOwner, - expectedTransferAmounts: TransferAmounts, - ): [ERC20BalancesByOwner, ERC721TokenIdsByOwner] { - const makerAddressLeft = signedOrderLeft.makerAddress; - const makerAddressRight = signedOrderRight.makerAddress; - const feeRecipientAddressLeft = signedOrderLeft.feeRecipientAddress; - const feeRecipientAddressRight = signedOrderRight.feeRecipientAddress; - // Operations are performed on copies of the balances - const expectedNewERC20BalancesByOwner = _.cloneDeep(erc20BalancesByOwner); - const expectedNewERC721TokenIdsByOwner = _.cloneDeep(erc721TokenIdsByOwner); - // Left Maker Asset (Right Taker Asset) - const makerAssetProxyIdLeft = assetProxyUtils.decodeProxyDataId(signedOrderLeft.makerAssetData); - if (makerAssetProxyIdLeft === AssetProxyId.ERC20) { - // Decode asset data - const erc20ProxyData = assetProxyUtils.decodeERC20ProxyData(signedOrderLeft.makerAssetData); - const makerAssetAddressLeft = erc20ProxyData.tokenAddress; - const takerAssetAddressRight = makerAssetAddressLeft; - // Left Maker - expectedNewERC20BalancesByOwner[makerAddressLeft][makerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ - makerAddressLeft - ][makerAssetAddressLeft].minus(expectedTransferAmounts.amountSoldByLeftMaker); - // Right Maker - expectedNewERC20BalancesByOwner[makerAddressRight][ - takerAssetAddressRight - ] = expectedNewERC20BalancesByOwner[makerAddressRight][takerAssetAddressRight].add( - expectedTransferAmounts.amountReceivedByRightMaker, - ); - // Taker - expectedNewERC20BalancesByOwner[takerAddress][makerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ - takerAddress - ][makerAssetAddressLeft].add(expectedTransferAmounts.amountReceivedByTaker); - } else if (makerAssetProxyIdLeft === AssetProxyId.ERC721) { - // Decode asset data - const erc721ProxyData = assetProxyUtils.decodeERC721ProxyData(signedOrderLeft.makerAssetData); - const makerAssetAddressLeft = erc721ProxyData.tokenAddress; - const makerAssetIdLeft = erc721ProxyData.tokenId; - const takerAssetAddressRight = makerAssetAddressLeft; - const takerAssetIdRight = makerAssetIdLeft; - // Left Maker - _.remove(expectedNewERC721TokenIdsByOwner[makerAddressLeft][makerAssetAddressLeft], makerAssetIdLeft); - // Right Maker - expectedNewERC721TokenIdsByOwner[makerAddressRight][takerAssetAddressRight].push(takerAssetIdRight); - // Taker: Since there is only 1 asset transferred, the taker does not receive any of the left maker asset. - } - // Left Taker Asset (Right Maker Asset) - // Note: This exchange is only between the order makers: the Taker does not receive any of the left taker asset. - const takerAssetProxyIdLeft = assetProxyUtils.decodeProxyDataId(signedOrderLeft.takerAssetData); - if (takerAssetProxyIdLeft === AssetProxyId.ERC20) { - // Decode asset data - const erc20ProxyData = assetProxyUtils.decodeERC20ProxyData(signedOrderLeft.takerAssetData); - const takerAssetAddressLeft = erc20ProxyData.tokenAddress; - const makerAssetAddressRight = takerAssetAddressLeft; - // Left Maker - expectedNewERC20BalancesByOwner[makerAddressLeft][takerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ - makerAddressLeft - ][takerAssetAddressLeft].add(expectedTransferAmounts.amountReceivedByLeftMaker); - // Right Maker - expectedNewERC20BalancesByOwner[makerAddressRight][ - makerAssetAddressRight - ] = expectedNewERC20BalancesByOwner[makerAddressRight][makerAssetAddressRight].minus( - expectedTransferAmounts.amountSoldByRightMaker, - ); - } else if (takerAssetProxyIdLeft === AssetProxyId.ERC721) { - // Decode asset data - const erc721ProxyData = assetProxyUtils.decodeERC721ProxyData(signedOrderRight.makerAssetData); - const makerAssetAddressRight = erc721ProxyData.tokenAddress; - const makerAssetIdRight = erc721ProxyData.tokenId; - const takerAssetAddressLeft = makerAssetAddressRight; - const takerAssetIdLeft = makerAssetIdRight; - // Right Maker - _.remove(expectedNewERC721TokenIdsByOwner[makerAddressRight][makerAssetAddressRight], makerAssetIdRight); - // Left Maker - expectedNewERC721TokenIdsByOwner[makerAddressLeft][takerAssetAddressLeft].push(takerAssetIdLeft); - } - // Left Maker Fees - expectedNewERC20BalancesByOwner[makerAddressLeft][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ - makerAddressLeft - ][this._feeTokenAddress].minus(expectedTransferAmounts.feePaidByLeftMaker); - // Right Maker Fees - expectedNewERC20BalancesByOwner[makerAddressRight][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ - makerAddressRight - ][this._feeTokenAddress].minus(expectedTransferAmounts.feePaidByRightMaker); - // Taker Fees - expectedNewERC20BalancesByOwner[takerAddress][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ - takerAddress - ][this._feeTokenAddress].minus(expectedTransferAmounts.totalFeePaidByTaker); - // Left Fee Recipient Fees - expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][ - this._feeTokenAddress - ] = expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][this._feeTokenAddress].add( - expectedTransferAmounts.feeReceivedLeft, - ); - // Right Fee Recipient Fees - expectedNewERC20BalancesByOwner[feeRecipientAddressRight][ - this._feeTokenAddress - ] = expectedNewERC20BalancesByOwner[feeRecipientAddressRight][this._feeTokenAddress].add( - expectedTransferAmounts.feeReceivedRight, - ); - - return [expectedNewERC20BalancesByOwner, expectedNewERC721TokenIdsByOwner]; - } -} -- cgit v1.2.3 From c9aef166495c0a1b1c34db01226602375c0b3547 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 23 May 2018 10:39:56 -0700 Subject: Fix linter issues --- packages/sol-cov/src/trace.ts | 3 ++- packages/utils/src/address_utils.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index cb5410909..6caea1610 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -9,7 +9,8 @@ export interface TraceByContractAddress { } function getAddressFromStackEntry(stackEntry: string): string { - return addressUtils.padZeros(new BigNumber(addHexPrefix(stackEntry)).toString(16)); + const hexBase = 16; + return addressUtils.padZeros(new BigNumber(addHexPrefix(stackEntry)).toString(hexBase)); } export function getTracesByContractAddress(structLogs: StructLog[], startAddress: string): TraceByContractAddress { diff --git a/packages/utils/src/address_utils.ts b/packages/utils/src/address_utils.ts index cc43bd477..1fc960408 100644 --- a/packages/utils/src/address_utils.ts +++ b/packages/utils/src/address_utils.ts @@ -4,6 +4,7 @@ import * as _ from 'lodash'; const BASIC_ADDRESS_REGEX = /^(0x)?[0-9a-f]{40}$/i; const SAME_CASE_ADDRESS_REGEX = /^(0x)?([0-9a-f]{40}|[0-9A-F]{40})$/; +const ADDRESS_LENGTH = 40; export const addressUtils = { isChecksumAddress(address: string): boolean { @@ -11,8 +12,7 @@ export const addressUtils = { const unprefixedAddress = address.replace('0x', ''); const addressHash = jsSHA3.keccak256(unprefixedAddress.toLowerCase()); - const addressLength = 40; - for (let i = 0; i < addressLength; i++) { + for (let i = 0; i < ADDRESS_LENGTH; i++) { // The nth letter should be uppercase if the nth digit of casemap is 1 const hexBase = 16; const lowercaseRange = 7; @@ -41,6 +41,6 @@ export const addressUtils = { } }, padZeros(address: string): string { - return addHexPrefix(_.padStart(stripHexPrefix(address), 40, '0')); + return addHexPrefix(_.padStart(stripHexPrefix(address), ADDRESS_LENGTH, '0')); }, }; -- cgit v1.2.3 From 2ddd53b355c87e71d740344cb349ddbcf2a652c1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 23 May 2018 10:49:08 -0700 Subject: Fix trace test --- packages/sol-cov/test/trace_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts index 93696b04a..c140cba0d 100644 --- a/packages/sol-cov/test/trace_test.ts +++ b/packages/sol-cov/test/trace_test.ts @@ -32,7 +32,7 @@ describe('Trace', () => { const trace = [ { op: OpCode.DelegateCall, - stack: [delegateCallAddress, '0x', '0x', '0x', '0x'], + stack: [delegateCallAddress, '0x'], depth: 0, }, { -- cgit v1.2.3 From bf18a90da79d43e90901b0cd156f15398e215d91 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 23 May 2018 11:21:02 -0700 Subject: Upgrade solidity parser --- packages/sol-cov/package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 74ffa72bd..f18315a26 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -59,7 +59,7 @@ "mkdirp": "^0.5.1", "rimraf": "^2.6.2", "semaphore-async-await": "^1.5.1", - "solidity-parser-antlr": "^0.2.8" + "solidity-parser-antlr": "^0.2.11" }, "devDependencies": { "@0xproject/monorepo-scripts": "^0.1.20", diff --git a/yarn.lock b/yarn.lock index 42c4fa025..8601e0338 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10507,9 +10507,9 @@ solc@^0.4.24: semver "^5.3.0" yargs "^4.7.1" -solidity-parser-antlr@^0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.2.8.tgz#8eb8547a88dfeaf6cf4c7811e3824084214244d4" +solidity-parser-antlr@^0.2.11: + version "0.2.11" + resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.2.11.tgz#b3e4d0aca0d15796e9b59da53a49137aab51c298" sort-keys@^1.0.0: version "1.1.2" -- cgit v1.2.3 From f6b81f588d98e09e7a5806902d94e2892d029481 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 23 May 2018 13:30:09 -0700 Subject: Add missing dep to website --- packages/website/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/website/package.json b/packages/website/package.json index e57404ca9..a91437646 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -21,6 +21,7 @@ "@0xproject/react-docs": "^0.0.12", "@0xproject/react-shared": "^0.1.7", "@0xproject/subproviders": "^0.10.2", + "@0xproject/contract-wrappers": "^0.0.2", "@0xproject/typescript-typings": "^0.3.2", "@0xproject/utils": "^0.6.2", "@0xproject/web3-wrapper": "^0.6.4", -- cgit v1.2.3