From 1658699434f621bb7701b635eefcc2325b160f05 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Mon, 17 Apr 2023 17:43:03 +0200 Subject: [PATCH 1/8] Adding NFT balance command --- package.json | 2 +- resources/commands.json | 53 ++++++++++++++++++++++++++++++++ src/commands/index.ts | 1 + src/commands/nfts/balanceNft.ts | 43 ++++++++++++++++++++++++++ test/helpers/Config.ts | 2 ++ test/integration/NFTs721.test.ts | 10 ++++++ 6 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/commands/nfts/balanceNft.ts diff --git a/package.json b/package.json index 8c00076..ccab849 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/cli", - "version": "1.1.1", + "version": "1.1.2", "main": "index.js", "repository": "git@github.com:nevermined-io/cli.git", "author": "Nevermined", diff --git a/resources/commands.json b/resources/commands.json index 5f2df45..0384663 100644 --- a/resources/commands.json +++ b/resources/commands.json @@ -983,6 +983,31 @@ "description": "The NFT type" } ] + }, { + "name": "balance [nftAddress]", + "description": "It gets the balance of a NFT", + "details": "This command allows to check if an address is a holder of a specific NFT wrapped by a Nevermined DID", + "examples": ["ncli nfts721 hold did:nv:afd733c23c41af948be7ec039c3fb2048d437e082a69ea3f336cdf452a49be7e"], + "commandHandler": "balanceNft", + "positionalArguments": [{ + "name": "nftAddress", + "type": "string", + "description": "The NFT contract address" + }], + "optionalArguments": [{ + "name": "address", + "type": "string", + "default": "", + "description": "The address of the account to get the balance" + }, + { + "name": "nftType", + "type": "number", + "default": "721", + "hidden": true, + "description": "The NFT type" + } + ] }, { "name": "mint [did]", "description": "Mints a ERC-721 NFT", @@ -1396,6 +1421,34 @@ "description": "The NFT type" } ] + }, { + "name": "balance [nftAddress] [did]", + "description": "It gets the balance of a NFT", + "details": "This command allows to check if an address is a holder of a specific NFT wrapped by a Nevermined DID", + "examples": ["ncli nfts1155 hold did:nv:afd733c23c41af948be7ec039c3fb2048d437e082a69ea3f336cdf452a49be7e"], + "commandHandler": "balanceNft", + "positionalArguments": [{ + "name": "nftAddress", + "type": "string", + "description": "The NFT contract address" + }, { + "name": "did", + "type": "string", + "description": "The asset DID" + }], + "optionalArguments": [{ + "name": "address", + "type": "string", + "default": "", + "description": "The address of the account to get the balance" + }, { + "name": "nftType", + "type": "number", + "default": "1155", + "hidden": true, + "description": "The NFT type" + } + ] }, { "name": "mint [did]", "description": "Mints a ERC-1155 NFT", diff --git a/src/commands/index.ts b/src/commands/index.ts index a2ee0be..4bb190e 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -12,6 +12,7 @@ export * from './assets/retireDID' export * from './nfts/cloneNft' export * from './nfts/deployNft' export * from './nfts/createNft' +export * from './nfts/balanceNft' export * from './nfts/holdNft' export * from './nfts/mintNft' export * from './nfts/showNft' diff --git a/src/commands/nfts/balanceNft.ts b/src/commands/nfts/balanceNft.ts new file mode 100644 index 0000000..2c48ede --- /dev/null +++ b/src/commands/nfts/balanceNft.ts @@ -0,0 +1,43 @@ +import { Account, didZeroX, Nevermined, zeroX } from '@nevermined-io/sdk' +import { StatusCodes } from '../../utils' +import { ExecutionOutput } from '../../models/ExecutionOutput' +import chalk from 'chalk' +import { Logger } from 'log4js' +import { ConfigEntry } from '../../models/ConfigDefinition' + +export const balanceNft = async ( + nvm: Nevermined, + consumerAccount: Account, + argv: any, + config: ConfigEntry, + logger: Logger +): Promise => { + const { nftAddress } = argv + + const nftType = Number(argv.nftType) + + let balance + const userAddress = argv.address ? argv.address : consumerAccount.getId() + + logger.info( + chalk.dim(`Gets the balance of the account ${userAddress} for the NFT-${nftType} with address ${chalk.whiteBright(nftAddress)}`) + ) + + if (nftType === 721) { + const nft = await nvm.contracts.loadNft721(nftAddress) + balance = await nft.balanceOf(userAddress) + logger.info(`The user holds ${balance} token/s of the ERC-${nftType} NFT`) + } else { + const nft = await nvm.contracts.loadNft1155Contract(nftAddress) + balance = await nft.balance(userAddress, zeroX(didZeroX(argv.did))) + logger.info(`The user holds ${balance} edition/s of the ERC-${nftType} NFT`) + } + + return { + status: StatusCodes.OK, + results: JSON.stringify({ + balance + }) + } + +} diff --git a/test/helpers/Config.ts b/test/helpers/Config.ts index e409aa2..2beef87 100644 --- a/test/helpers/Config.ts +++ b/test/helpers/Config.ts @@ -71,6 +71,7 @@ export const baseCommands = { show: `${BASE_COMMAND} ${VERBOSE} nfts721 show `, mint: `${BASE_COMMAND} ${VERBOSE} nfts721 mint `, hold: `${BASE_COMMAND} ${VERBOSE} nfts721 hold `, + balance: `${BASE_COMMAND} ${VERBOSE} nfts721 balance `, burn: `${BASE_COMMAND} ${VERBOSE} nfts721 burn `, order: `${BASE_COMMAND} ${VERBOSE} nfts721 order `, claim: `${BASE_COMMAND} ${VERBOSE} nfts721 claim `, @@ -84,6 +85,7 @@ export const baseCommands = { create: `${BASE_COMMAND} ${VERBOSE} nfts1155 create `, show: `${BASE_COMMAND} ${VERBOSE} nfts1155 show `, hold: `${BASE_COMMAND} ${VERBOSE} nfts1155 hold `, + balance: `${BASE_COMMAND} ${VERBOSE} nfts721 balance `, mint: `${BASE_COMMAND} ${VERBOSE} nfts1155 mint `, burn: `${BASE_COMMAND} ${VERBOSE} nfts1155 burn `, order: `${BASE_COMMAND} ${VERBOSE} nfts1155 order `, diff --git a/test/integration/NFTs721.test.ts b/test/integration/NFTs721.test.ts index 856ae5c..a6f1662 100644 --- a/test/integration/NFTs721.test.ts +++ b/test/integration/NFTs721.test.ts @@ -112,6 +112,16 @@ describe('NFTs (ERC-721) e2e Testing', () => { expect(stdout.includes(`Transfer done!`)) }) + test('The buyer can see the NFT balance (ERC-721)', async () => { + const balanceCommand = `${baseCommands.nfts721.balance} "${nftAddress}" "${execOpts.accounts[1]}" --accountIndex 1 ` + console.debug(`COMMAND: ${balanceCommand}`) + + const stdout = execCommand(balanceCommand, execOpts) + + console.debug(`STDOUT: ${stdout}`) + expect(stdout.includes(`The user holds 1`)) + }) + test('As NFT holder I can download the files associated to an asset', async () => { const destination = `/tmp/nevemined/cli/test/nft` const downloadCommand = `${baseCommands.nfts721.download} "${did}" --destination "${destination}" --accountIndex 1 ` From 1158b1016cfe71fd0adff606c993a75781c48cb9 Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Fri, 28 Apr 2023 13:19:04 +0200 Subject: [PATCH 2/8] Update to contracts 3.1.0 - bumped version to 1.2.0 - updated the CI to use contracts 3.1.0 --- .github/workflows/testing.yml | 18 +++++++++--------- package.json | 2 +- resources/networks.json | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c2b3c31..c36eb9d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -25,12 +25,12 @@ jobs: yarn build yarn start --help - - uses: nevermined-io/nvm-tools-actions@v0.9.0 + - uses: nevermined-io/nvm-tools-actions@v0.10.0 with: token: ${{ secrets.API_TOKEN_GITHUB }} - opengsn: "true" - estuary: "true" - contracts-version: "v3.0.0" + opengsn: 'true' + estuary: 'true' + contracts-version: 'v3.1.0' - name: Check artifacts and circuits run: | nvm-tools copy-artifacts /tmp/.nevermined/artifacts @@ -41,14 +41,14 @@ jobs: - name: Run integration tests env: - LOCAL_CONF_DIR: "/tmp/.nevermined" + LOCAL_CONF_DIR: '/tmp/.nevermined' SEED_WORDS: ${{ secrets.TEST_MNEMONIC }} - TOKEN_ADDRESS: "0x0000000000000000000000000000000000000000" - WEB3_PROVIDER_URL: "http://contracts.nevermined.localnet" - NETWORK: "geth-localnet" + TOKEN_ADDRESS: '0x0000000000000000000000000000000000000000' + WEB3_PROVIDER_URL: 'http://contracts.nevermined.localnet' + NETWORK: 'geth-localnet' IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }} IPFS_PROJECT_SECRET: ${{ secrets.IPFS_PROJECT_SECRET }} - NO_GRAPH: "true" + NO_GRAPH: 'true' run: | yarn test:integration - name: Upload logs diff --git a/package.json b/package.json index 8c00076..7da0748 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/cli", - "version": "1.1.1", + "version": "1.2.0", "main": "index.js", "repository": "git@github.com:nevermined-io/cli.git", "author": "Nevermined", diff --git a/resources/networks.json b/resources/networks.json index 533628c..ad3bb6c 100644 --- a/resources/networks.json +++ b/resources/networks.json @@ -14,7 +14,7 @@ "nativeToken": "MATIC", "networkId": "80001", "networkName": "mumbai", - "contractsVersion": "3.0.0", + "contractsVersion": "3.1.0", "tagName": "public", "etherscanUrl": "https://mumbai.polygonscan.com", "erc20TokenAddress": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62", @@ -192,7 +192,7 @@ "nativeToken": "MATIC", "networkId": "80001", "networkName": "mumbai", - "contractsVersion": "3.0.0", + "contractsVersion": "3.1.0", "tagName": "public", "etherscanUrl": "https://mumbai.polygonscan.com", "erc20TokenAddress": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62", From 798ce764ebd250ecf0433fc77472ec4693e55681 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:42:42 +0200 Subject: [PATCH 3/8] v3.1.0 --- resources/networks.json | 2 +- .../nfts/NFT721SubscriptionUpgradeable.json | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/resources/networks.json b/resources/networks.json index 533628c..136292f 100644 --- a/resources/networks.json +++ b/resources/networks.json @@ -192,7 +192,7 @@ "nativeToken": "MATIC", "networkId": "80001", "networkName": "mumbai", - "contractsVersion": "3.0.0", + "contractsVersion": "3.1.0", "tagName": "public", "etherscanUrl": "https://mumbai.polygonscan.com", "erc20TokenAddress": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62", diff --git a/test/resources/nfts/NFT721SubscriptionUpgradeable.json b/test/resources/nfts/NFT721SubscriptionUpgradeable.json index fc2b40c..f32e0be 100644 --- a/test/resources/nfts/NFT721SubscriptionUpgradeable.json +++ b/test/resources/nfts/NFT721SubscriptionUpgradeable.json @@ -796,6 +796,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "nftType", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "nvmConfig", @@ -1176,8 +1189,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50613847806100206000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c806301ffc9a71461026157806302acb9a61461028957806305a148721461029e57806306fdde03146102be578063081812fc146102d3578063095ea7b3146102e6578063156e29f6146102f9578063162790551461030c57806322e8e1e014610320578063237c49191461033657806323b872dd14610349578063248a9ca31461035c57806327ac0c581461036f5780632a55205a146103825780632f2ff15d146103b457806336568abe146103c75780633d6d3598146103da57806340c10f19146103e257806342842e0e146103f557806342966c681461040857806347c4ef251461041b578063572b6c051461043e5780635ced058e146104515780635ea3ab85146104625780636352211e146104755780636d70f7ae146104885780636fd902e11461049b57806370a08231146104a1578063715018a6146104b457806382c947b7146104bc57806385be5724146104d65780638da5cb5b146104eb57806391d14854146104f357806395d89b41146105065780639713c8071461050e578063a0712d6814610521578063a217fddf14610534578063a22cb4651461053c578063ab9de2301461054f578063b219f7d714610557578063b88d4fde1461056a578063c87b56dd1461057d578063cbd5a40e14610590578063ce1b815f146105b0578063d2423105146105b8578063d547741f146105cb578063ded96d48146105de578063e271d9ee146105f1578063e8a3d48514610611578063e985e9c514610619578063e9c1e0451461062c578063f2fde38b1461063f575b600080fd5b61027461026f3660046129c4565b610652565b60405190151581526020015b60405180910390f35b61029c6102973660046129f6565b61068d565b005b6102b16102ac366004612af3565b6106b7565b6040516102809190612c0c565b6102c66108c0565b6040516102809190612c70565b6102b16102e1366004612c83565b610952565b61029c6102f4366004612c9c565b610979565b61029c610307366004612cc8565b610aa5565b61027461031a3660046129f6565b3b151590565b610328610b10565b604051908152602001610280565b61029c610344366004612cfd565b610b21565b61029c610357366004612d39565b610b56565b61032861036a366004612c83565b610b8e565b61029c61037d3660046129f6565b610ba3565b610395610390366004612d7a565b610c0e565b604080516001600160a01b039093168352602083019190915201610280565b61029c6103c2366004612d9c565b610c64565b61029c6103d5366004612d9c565b610c80565b61029c610d0a565b61029c6103f0366004612c9c565b610d2b565b61029c610403366004612d39565b610f26565b61029c610416366004612c83565b610f41565b61042e610429366004612c83565b6111df565b6040516102809493929190612dcc565b61027461044c3660046129f6565b6112dc565b6102b161045f366004612c83565b90565b610328610470366004612dfd565b611301565b6102b1610483366004612c83565b611350565b6102746104963660046129f6565b611384565b43610328565b6103286104af3660046129f6565b61139e565b61029c6114b7565b6103286104ca3660046129f6565b6001600160a01b031690565b6103286000805160206137d283398151915281565b6102b16114c9565b610274610501366004612d9c565b6114d8565b6102c6611503565b61029c61051c366004612e8d565b611512565b61029c61052f366004612c83565b611544565b610328600081565b61029c61054a366004612ec2565b611555565b6102b1611567565b61029c6105653660046129f6565b611576565b61029c610578366004612ef0565b6115de565b6102c661058b366004612c83565b61161d565b6105a361059e3660046129f6565b6116be565b6040516102809190612f6f565b6102b1611752565b61029c6105c6366004612fc8565b6117dd565b61029c6105d9366004612d9c565b611839565b61029c6105ec366004612ffc565b611855565b6106046105ff3660046129f6565b611a38565b60405161028091906130b1565b6102c6611b29565b6102746106273660046130f5565b611b38565b60ff546102b1906001600160a01b031681565b61029c61064d3660046129f6565b611b72565b600061065d82611be8565b8061066c575061066c82611c09565b8061068757506001600160e01b0319821663152a902d60e11b145b92915050565b610695611c59565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806106ed5750305b60006106f882611cc8565b9050806001600160a01b03811663ded96d48610712611d62565b610101546040516001600160e01b031960e085901b16815261074992916001600160a01b0316908e908e908e908e90600401613123565b600060405180830381600087803b15801561076357600080fd5b505af1158015610777573d6000803e3d6000fd5b5050505060005b855181101561081157816001600160a01b03166327ac0c588783815181106107a8576107a8613189565b60200260200101516040518263ffffffff1660e01b81526004016107cc9190612c0c565b600060405180830381600087803b1580156107e657600080fd5b505af11580156107fa573d6000803e3d6000fd5b505050508080610809906131b5565b91505061077e565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561084d57600080fd5b505af1158015610861573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d16040516108ac91815260200190565b60405180910390a350979650505050505050565b6060609780546108cf906131ce565b80601f01602080910402602001604051908101604052809291908181526020018280546108fb906131ce565b80156109485780601f1061091d57610100808354040283529160200191610948565b820191906000526020600020905b81548152906001019060200180831161092b57829003601f168201915b5050505050905090565b600061095d82611d6c565b506000908152609b60205260409020546001600160a01b031690565b600061098482611350565b9050806001600160a01b0316836001600160a01b0316036109f65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a08611d62565b6001600160a01b03161480610a245750610a2481610627611d62565b610a965760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016109ed565b610aa08383611d91565b505050565b610aaf8383610d2b565b6001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610b1c6101025490565b905090565b610b2c610496611d62565b610b485760405162461bcd60e51b81526004016109ed90613202565b610b528282611dff565b5050565b610b67610b61611d62565b82611e25565b610b835760405162461bcd60e51b81526004016109ed9061322d565b610aa0838383611e84565b600090815260c9602052604090206001015490565b610bab611d62565b6001600160a01b0316610bbc6114c9565b6001600160a01b03161480610bd75750610bd7610496611d62565b610bf35760405162461bcd60e51b81526004016109ed9061327a565b610c0b6000805160206137d283398151915282611fe3565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c5090866132aa565b610c5a91906132c1565b9150509250929050565b610c6d82610b8e565b610c7681611fed565b610aa08383611ffe565b610c88611d62565b6001600160a01b0316816001600160a01b031614610d005760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016109ed565b610b528282612085565b610d296000805160206137d2833981519152610d24611d62565b612085565b565b610d36610496611d62565b80610d595750610d446114c9565b6001600160a01b0316826001600160a01b0316145b610da25760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b60448201526064016109ed565b610100541580610db757506101005461010254105b610df85760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b60448201526064016109ed565b610e0761010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610e449082613331565b50610101546001600160a01b031663bb794d9282610e60611d62565b600143604051602001610e769493929190613407565b604051602081830303815290604052805190602001208360001b610e98611d62565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b8152600401610ed89493929190613446565b6020604051808303816000875af1158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b9190613486565b50610b52828261210a565b610aa0838383604051806020016040528060008152506115de565b610f4c610496611d62565b80610f775750610f5a611d62565b6001600160a01b0316610f6c82611350565b6001600160a01b0316145b610fdb5760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b60648201526084016109ed565b600160fc6000838152602001908152602001600020600101600082825461100291906134a3565b9091555050610101546001600160a01b031663bb794d9282611022611d62565b60014360405160200161103894939291906134cd565b604051602081830303815290604052805190602001208360001b61105a611d62565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b815260040161109a94939291906134f6565b6020604051808303816000875af11580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd9190613486565b506110e781612213565b60005b61010360006110f7611d62565b6001600160a01b03168152602081019190915260400160002054811015610b5257816101036000611126611d62565b6001600160a01b03166001600160a01b03168152602001908152602001600020828154811061115757611157613189565b906000526020600020906003020160000154036111cd57610103600061117b611d62565b6001600160a01b03166001600160a01b0316815260200190815260200160002081815481106111ac576111ac613189565b60009182526020822060039091020181815560018101829055600201555050565b806111d7816131b5565b9150506110ea565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190611236906131ce565b80601f0160208091040260200160405190810160405280929190818152602001828054611262906131ce565b80156112af5780601f10611284576101008083540402835291602001916112af565b820191906000526020600020905b81548152906001019060200180831161129257829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b60006112e6611752565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156113495783818151811061132257611322613189565b6020026020010151826113359190613536565b915080611341816131b5565b915050611307565b5092915050565b60008061135c836122a4565b90506001600160a01b0381166106875760405162461bcd60e51b81526004016109ed90613549565b60006106876000805160206137d2833981519152836114d8565b60008060005b6001600160a01b03841660009081526101036020526040902054811015611349576001600160a01b0384166000908152610103602052604081208054839081106113f0576113f0613189565b90600052602060002090600302016002015411801561149257506001600160a01b03841660009081526101036020526040902080548290811061143557611435613189565b9060005260206000209060030201600101546000148061149257506001600160a01b03841660009081526101036020526040902080544391908390811061147e5761147e613189565b906000526020600020906003020160010154115b156114a5576114a2600183613536565b91505b806114af816131b5565b9150506113a4565b6114bf611c59565b610d2960006122bf565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060609880546108cf906131ce565b61151d610496611d62565b6115395760405162461bcd60e51b81526004016109ed90613202565b610aa0838383612311565b610c0b61154f611d62565b82610d2b565b610b52611560611d62565b83836123a9565b60ff546001600160a01b031690565b61157e611d62565b6001600160a01b031661158f6114c9565b6001600160a01b031614806115aa57506115aa610496611d62565b6115c65760405162461bcd60e51b81526004016109ed9061327a565b610c0b6000805160206137d283398151915282612085565b6115ef6115e9611d62565b83611e25565b61160b5760405162461bcd60e51b81526004016109ed9061322d565b61161784848484612473565b50505050565b606060006116296124a6565b9050611634836124b0565b156116895760008151116116575760405180602001604052806000815250611682565b80611661846124cd565b60405160200161167292919061357b565b6040516020818303038152906040525b9392505050565b60008151116116a75760405180602001604052806000815250611682565b8060405160200161167291906135aa565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561174757838290600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050815260200190600101906116f7565b505050509050919050565b60008061175d611567565b90506001600160a01b03811661177557600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d791906135c6565b91505090565b6117e5611d62565b6001600160a01b03166117f66114c9565b6001600160a01b031614806118115750611811610496611d62565b61182d5760405162461bcd60e51b81526004016109ed9061327a565b60fe610b528282613331565b61184282610b8e565b61184b81611fed565b610aa08383612085565b600054610100900460ff16158080156118755750600054600160ff909116105b806118965750611884306124e4565b158015611896575060005460ff166001145b6118f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109ed565b6000805460ff19166001179055801561191c576000805461ff0019166101001790555b6119246124f3565b61192c6124f3565b611936858561251a565b61193e61255a565b6119466124f3565b6119656000805160206137d2833981519152611960611d62565b611fe3565b61197d6000805160206137d283398151915287611fe3565b6119956000805160206137d283398151915288611fe3565b61199e836117dd565b61010082905561010180546001600160a01b0319166001600160a01b0388161790556119c8611d62565b6001600160a01b0316876001600160a01b0316146119e9576119e987611b72565b8015611a2f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611a6d57611a6d612a13565b604051908082528060200260200182016040528015611a96578160200160208202803683370190505b50905060005b6001600160a01b03841660009081526101036020526040902054811015611349576001600160a01b038416600090815261010360205260409020805482908110611ae857611ae8613189565b906000526020600020906003020160020154828281518110611b0c57611b0c613189565b602090810291909101015280611b21816131b5565b915050611a9c565b606060fe80546108cf906131ce565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff1680611682575061168282611384565b611b7a611c59565b6001600160a01b038116611bdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109ed565b610c0b816122bf565b60006001600160e01b03198216637965db0b60e01b14806106875750610687825b60006001600160e01b031982166380ac58cd60e01b1480611c3a57506001600160e01b03198216635b5e139f60e01b145b8061068757506301ffc9a760e01b6001600160e01b0319831614610687565b611c61611d62565b6001600160a01b0316611c726114c9565b6001600160a01b031614610d295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109ed565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611d5d5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60448201526064016109ed565b919050565b6000610b1c612591565b611d75816124b0565b610c0b5760405162461bcd60e51b81526004016109ed90613549565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611dc682611350565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610aa08282613331565b600080611e3183611350565b9050806001600160a01b0316846001600160a01b03161480611e585750611e588185611b38565b80611e7c5750836001600160a01b0316611e7184610952565b6001600160a01b0316145b949350505050565b826001600160a01b0316611e9782611350565b6001600160a01b031614611ebd5760405162461bcd60e51b81526004016109ed906135e3565b6001600160a01b038216611f1f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109ed565b611f2c83838360016125bf565b826001600160a01b0316611f3f82611350565b6001600160a01b031614611f655760405162461bcd60e51b81526004016109ed906135e3565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184936000805160206137f283398151915291a4505050565b610b528282611ffe565b610c0b81611ff9611d62565b61262b565b61200882826114d8565b610b5257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612041611d62565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61208f82826114d8565b15610b5257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556120c6611d62565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166121605760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109ed565b612169816124b0565b156121865760405162461bcd60e51b81526004016109ed90613628565b6121946000838360016125bf565b61219d816124b0565b156121ba5760405162461bcd60e51b81526004016109ed90613628565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291906000805160206137f2833981519152908290a45050565b600061221e82611350565b905061222e8160008460016125bf565b61223782611350565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a845282852080546000190190558785526099909352818420805490911690555192935084926000805160206137f2833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123615760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b60448201526064016109ed565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036124065760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016109ed565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61247e848484611e84565b61248a84848484612684565b6116175760405162461bcd60e51b81526004016109ed9061365e565b6060610b1c611b29565b6000806124bc836122a4565b6001600160a01b0316141592915050565b6060610687826124dc84612793565b6001016127fd565b6001600160a01b03163b151590565b600054610100900460ff16610d295760405162461bcd60e51b81526004016109ed906136b0565b600054610100900460ff166125415760405162461bcd60e51b81526004016109ed906136b0565b609761254d8382613331565b506098610aa08282613331565b600054610100900460ff166125815760405162461bcd60e51b81526004016109ed906136b0565b610d2961258c611d62565b6122bf565b6000601436108015906125a857506125a8336112dc565b156125ba575060131936013560601c90565b503390565b6001600160a01b03841615806125dc57506001600160a01b038316155b806125ed57506125ed610496611d62565b6126265760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b60448201526064016109ed565b611617565b61263582826114d8565b610b525761264281612998565b61264d8360206127fd565b60405160200161265e9291906136fb565b60408051601f198184030181529082905262461bcd60e51b82526109ed91600401612c70565b6000612698846001600160a01b03166124e4565b1561278857836001600160a01b031663150b7a026126b4611d62565b8786866040518563ffffffff1660e01b81526004016126d6949392919061376a565b6020604051808303816000875af1925050508015612711575060408051601f3d908101601f1916820190925261270e9181019061379d565b60015b61276e573d80801561273f576040519150601f19603f3d011682016040523d82523d6000602084013e612744565b606091505b5080516000036127665760405162461bcd60e51b81526004016109ed9061365e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e7c565b506001949350505050565b600080608083901c156127ab5760809290921c916010015b604083901c156127c05760409290921c916008015b602083901c156127d55760209290921c916004015b601083901c156127ea5760109290921c916002015b600883901c156106875760010192915050565b6060600061280c8360026132aa565b612817906002613536565b6001600160401b0381111561282e5761282e612a13565b6040519080825280601f01601f191660200182016040528015612858576020820181803683370190505b509050600360fc1b8160008151811061287357612873613189565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106128a2576128a2613189565b60200101906001600160f81b031916908160001a90535060006128c68460026132aa565b6128d1906001613536565b90505b6001811115612949576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061290557612905613189565b1a60f81b82828151811061291b5761291b613189565b60200101906001600160f81b031916908160001a90535060049490941c93612942816137ba565b90506128d4565b5083156116825760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109ed565b60606106876001600160a01b03831660146127fd565b6001600160e01b031981168114610c0b57600080fd5b6000602082840312156129d657600080fd5b8135611682816129ae565b6001600160a01b0381168114610c0b57600080fd5b600060208284031215612a0857600080fd5b8135611682816129e1565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612a5157612a51612a13565b604052919050565b60006001600160401b03831115612a7257612a72612a13565b612a85601f8401601f1916602001612a29565b9050828152838383011115612a9957600080fd5b828260208301376000602084830101529392505050565b600082601f830112612ac157600080fd5b61168283833560208501612a59565b60006001600160401b03821115612ae957612ae9612a13565b5060051b60200190565b600080600080600060a08688031215612b0b57600080fd5b85356001600160401b0380821115612b2257600080fd5b612b2e89838a01612ab0565b9650602091508188013581811115612b4557600080fd5b612b518a828b01612ab0565b965050604088013581811115612b6657600080fd5b612b728a828b01612ab0565b95505060608801359350608088013581811115612b8e57600080fd5b88019050601f81018913612ba157600080fd5b8035612bb4612baf82612ad0565b612a29565b81815260059190911b8201830190838101908b831115612bd357600080fd5b928401925b82841015612bfa578335612beb816129e1565b82529284019290840190612bd8565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612c3b578181015183820152602001612c23565b50506000910152565b60008151808452612c5c816020860160208601612c20565b601f01601f19169290920160200192915050565b6020815260006116826020830184612c44565b600060208284031215612c9557600080fd5b5035919050565b60008060408385031215612caf57600080fd5b8235612cba816129e1565b946020939093013593505050565b600080600060608486031215612cdd57600080fd5b8335612ce8816129e1565b95602085013595506040909401359392505050565b60008060408385031215612d1057600080fd5b8235915060208301356001600160401b03811115612d2d57600080fd5b610c5a85828601612ab0565b600080600060608486031215612d4e57600080fd5b8335612d59816129e1565b92506020840135612d69816129e1565b929592945050506040919091013590565b60008060408385031215612d8d57600080fd5b50508035926020909101359150565b60008060408385031215612daf57600080fd5b823591506020830135612dc1816129e1565b809150509250929050565b8415158152836020820152826040820152608060608201526000612df36080830184612c44565b9695505050505050565b60006020808385031215612e1057600080fd5b82356001600160401b03811115612e2657600080fd5b8301601f81018513612e3757600080fd5b8035612e45612baf82612ad0565b81815260059190911b82018301908381019087831115612e6457600080fd5b928401925b82841015612e8257833582529284019290840190612e69565b979650505050505050565b600080600060608486031215612ea257600080fd5b833592506020840135612d69816129e1565b8015158114610c0b57600080fd5b60008060408385031215612ed557600080fd5b8235612ee0816129e1565b91506020830135612dc181612eb4565b60008060008060808587031215612f0657600080fd5b8435612f11816129e1565b93506020850135612f21816129e1565b92506040850135915060608501356001600160401b03811115612f4357600080fd5b8501601f81018713612f5457600080fd5b612f6387823560208401612a59565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b82811015612fbb5781518051855286810151878601528501518585015260609093019290850190600101612f8c565b5091979650505050505050565b600060208284031215612fda57600080fd5b81356001600160401b03811115612ff057600080fd5b611e7c84828501612ab0565b60008060008060008060c0878903121561301557600080fd5b8635613020816129e1565b95506020870135613030816129e1565b945060408701356001600160401b038082111561304c57600080fd5b6130588a838b01612ab0565b9550606089013591508082111561306e57600080fd5b61307a8a838b01612ab0565b9450608089013591508082111561309057600080fd5b5061309d89828a01612ab0565b92505060a087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b818110156130e9578351835292840192918401916001016130cd565b50909695505050505050565b6000806040838503121561310857600080fd5b8235613113816129e1565b91506020830135612dc1816129e1565b6001600160a01b0387811682528616602082015260c06040820181905260009061314f90830187612c44565b82810360608401526131618187612c44565b905082810360808401526131758186612c44565b9150508260a0830152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131c7576131c761319f565b5060010190565b600181811c908216806131e257607f821691505b6020821081036116b857634e487b7160e01b600052602260045260246000fd5b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106875761068761319f565b6000826132de57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610aa057600081815260208120601f850160051c8101602086101561330a5750805b601f850160051c820191505b8181101561332957828155600101613316565b505050505050565b81516001600160401b0381111561334a5761334a612a13565b61335e8161335884546131ce565b846132e3565b602080601f831160018114613393576000841561337b5750858301515b600019600386901b1c1916600185901b178555613329565b600085815260208120601f198616915b828110156133c2578886015182559484019460019091019084016133a3565b50858210156133e05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906134309083016133f0565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612df360e083016133f0565b60006020828403121561349857600080fd5b815161168281612eb4565b818103818111156106875761068761319f565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906134309083016134b6565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612df360e083016134b6565b808201808211156106875761068761319f565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b6000835161358d818460208801612c20565b8351908301906135a1818360208801612c20565b01949350505050565b600082516135bc818460208701612c20565b9190910192915050565b6000602082840312156135d857600080fd5b8151611682816129e1565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161372d816017850160208801612c20565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161375e816028840160208801612c20565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612df390830184612c44565b6000602082840312156137af57600080fd5b8151611682816129ae565b6000816137c9576137c961319f565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220a892f03eeb5d59460e09404f0e0be3a62423dd433d9ace990e83915678c8144e64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806301ffc9a71461026157806302acb9a61461028957806305a148721461029e57806306fdde03146102be578063081812fc146102d3578063095ea7b3146102e6578063156e29f6146102f9578063162790551461030c57806322e8e1e014610320578063237c49191461033657806323b872dd14610349578063248a9ca31461035c57806327ac0c581461036f5780632a55205a146103825780632f2ff15d146103b457806336568abe146103c75780633d6d3598146103da57806340c10f19146103e257806342842e0e146103f557806342966c681461040857806347c4ef251461041b578063572b6c051461043e5780635ced058e146104515780635ea3ab85146104625780636352211e146104755780636d70f7ae146104885780636fd902e11461049b57806370a08231146104a1578063715018a6146104b457806382c947b7146104bc57806385be5724146104d65780638da5cb5b146104eb57806391d14854146104f357806395d89b41146105065780639713c8071461050e578063a0712d6814610521578063a217fddf14610534578063a22cb4651461053c578063ab9de2301461054f578063b219f7d714610557578063b88d4fde1461056a578063c87b56dd1461057d578063cbd5a40e14610590578063ce1b815f146105b0578063d2423105146105b8578063d547741f146105cb578063ded96d48146105de578063e271d9ee146105f1578063e8a3d48514610611578063e985e9c514610619578063e9c1e0451461062c578063f2fde38b1461063f575b600080fd5b61027461026f3660046129c4565b610652565b60405190151581526020015b60405180910390f35b61029c6102973660046129f6565b61068d565b005b6102b16102ac366004612af3565b6106b7565b6040516102809190612c0c565b6102c66108c0565b6040516102809190612c70565b6102b16102e1366004612c83565b610952565b61029c6102f4366004612c9c565b610979565b61029c610307366004612cc8565b610aa5565b61027461031a3660046129f6565b3b151590565b610328610b10565b604051908152602001610280565b61029c610344366004612cfd565b610b21565b61029c610357366004612d39565b610b56565b61032861036a366004612c83565b610b8e565b61029c61037d3660046129f6565b610ba3565b610395610390366004612d7a565b610c0e565b604080516001600160a01b039093168352602083019190915201610280565b61029c6103c2366004612d9c565b610c64565b61029c6103d5366004612d9c565b610c80565b61029c610d0a565b61029c6103f0366004612c9c565b610d2b565b61029c610403366004612d39565b610f26565b61029c610416366004612c83565b610f41565b61042e610429366004612c83565b6111df565b6040516102809493929190612dcc565b61027461044c3660046129f6565b6112dc565b6102b161045f366004612c83565b90565b610328610470366004612dfd565b611301565b6102b1610483366004612c83565b611350565b6102746104963660046129f6565b611384565b43610328565b6103286104af3660046129f6565b61139e565b61029c6114b7565b6103286104ca3660046129f6565b6001600160a01b031690565b6103286000805160206137d283398151915281565b6102b16114c9565b610274610501366004612d9c565b6114d8565b6102c6611503565b61029c61051c366004612e8d565b611512565b61029c61052f366004612c83565b611544565b610328600081565b61029c61054a366004612ec2565b611555565b6102b1611567565b61029c6105653660046129f6565b611576565b61029c610578366004612ef0565b6115de565b6102c661058b366004612c83565b61161d565b6105a361059e3660046129f6565b6116be565b6040516102809190612f6f565b6102b1611752565b61029c6105c6366004612fc8565b6117dd565b61029c6105d9366004612d9c565b611839565b61029c6105ec366004612ffc565b611855565b6106046105ff3660046129f6565b611a38565b60405161028091906130b1565b6102c6611b29565b6102746106273660046130f5565b611b38565b60ff546102b1906001600160a01b031681565b61029c61064d3660046129f6565b611b72565b600061065d82611be8565b8061066c575061066c82611c09565b8061068757506001600160e01b0319821663152a902d60e11b145b92915050565b610695611c59565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b0316806106ed5750305b60006106f882611cc8565b9050806001600160a01b03811663ded96d48610712611d62565b610101546040516001600160e01b031960e085901b16815261074992916001600160a01b0316908e908e908e908e90600401613123565b600060405180830381600087803b15801561076357600080fd5b505af1158015610777573d6000803e3d6000fd5b5050505060005b855181101561081157816001600160a01b03166327ac0c588783815181106107a8576107a8613189565b60200260200101516040518263ffffffff1660e01b81526004016107cc9190612c0c565b600060405180830381600087803b1580156107e657600080fd5b505af11580156107fa573d6000803e3d6000fd5b505050508080610809906131b5565b91505061077e565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561084d57600080fd5b505af1158015610861573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d16040516108ac91815260200190565b60405180910390a350979650505050505050565b6060609780546108cf906131ce565b80601f01602080910402602001604051908101604052809291908181526020018280546108fb906131ce565b80156109485780601f1061091d57610100808354040283529160200191610948565b820191906000526020600020905b81548152906001019060200180831161092b57829003601f168201915b5050505050905090565b600061095d82611d6c565b506000908152609b60205260409020546001600160a01b031690565b600061098482611350565b9050806001600160a01b0316836001600160a01b0316036109f65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a08611d62565b6001600160a01b03161480610a245750610a2481610627611d62565b610a965760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016109ed565b610aa08383611d91565b505050565b610aaf8383610d2b565b6001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610b1c6101025490565b905090565b610b2c610496611d62565b610b485760405162461bcd60e51b81526004016109ed90613202565b610b528282611dff565b5050565b610b67610b61611d62565b82611e25565b610b835760405162461bcd60e51b81526004016109ed9061322d565b610aa0838383611e84565b600090815260c9602052604090206001015490565b610bab611d62565b6001600160a01b0316610bbc6114c9565b6001600160a01b03161480610bd75750610bd7610496611d62565b610bf35760405162461bcd60e51b81526004016109ed9061327a565b610c0b6000805160206137d283398151915282611fe3565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610c5090866132aa565b610c5a91906132c1565b9150509250929050565b610c6d82610b8e565b610c7681611fed565b610aa08383611ffe565b610c88611d62565b6001600160a01b0316816001600160a01b031614610d005760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016109ed565b610b528282612085565b610d296000805160206137d2833981519152610d24611d62565b612085565b565b610d36610496611d62565b80610d595750610d446114c9565b6001600160a01b0316826001600160a01b0316145b610da25760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b60448201526064016109ed565b610100541580610db757506101005461010254105b610df85760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b60448201526064016109ed565b610e0761010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610e449082613331565b50610101546001600160a01b031663bb794d9282610e60611d62565b600143604051602001610e769493929190613407565b604051602081830303815290604052805190602001208360001b610e98611d62565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b8152600401610ed89493929190613446565b6020604051808303816000875af1158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b9190613486565b50610b52828261210a565b610aa0838383604051806020016040528060008152506115de565b610f4c610496611d62565b80610f775750610f5a611d62565b6001600160a01b0316610f6c82611350565b6001600160a01b0316145b610fdb5760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b60648201526084016109ed565b600160fc6000838152602001908152602001600020600101600082825461100291906134a3565b9091555050610101546001600160a01b031663bb794d9282611022611d62565b60014360405160200161103894939291906134cd565b604051602081830303815290604052805190602001208360001b61105a611d62565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b815260040161109a94939291906134f6565b6020604051808303816000875af11580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd9190613486565b506110e781612213565b60005b61010360006110f7611d62565b6001600160a01b03168152602081019190915260400160002054811015610b5257816101036000611126611d62565b6001600160a01b03166001600160a01b03168152602001908152602001600020828154811061115757611157613189565b906000526020600020906003020160000154036111cd57610103600061117b611d62565b6001600160a01b03166001600160a01b0316815260200190815260200160002081815481106111ac576111ac613189565b60009182526020822060039091020181815560018101829055600201555050565b806111d7816131b5565b9150506110ea565b600081815260fc602090815260408083208151608081018352815460ff16151581526001820154938101939093526002810154918301919091526003810180548493849360609385938386019190611236906131ce565b80601f0160208091040260200160405190810160405280929190818152602001828054611262906131ce565b80156112af5780601f10611284576101008083540402835291602001916112af565b820191906000526020600020905b81548152906001019060200180831161129257829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b60006112e6611752565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156113495783818151811061132257611322613189565b6020026020010151826113359190613536565b915080611341816131b5565b915050611307565b5092915050565b60008061135c836122a4565b90506001600160a01b0381166106875760405162461bcd60e51b81526004016109ed90613549565b60006106876000805160206137d2833981519152836114d8565b60008060005b6001600160a01b03841660009081526101036020526040902054811015611349576001600160a01b0384166000908152610103602052604081208054839081106113f0576113f0613189565b90600052602060002090600302016002015411801561149257506001600160a01b03841660009081526101036020526040902080548290811061143557611435613189565b9060005260206000209060030201600101546000148061149257506001600160a01b03841660009081526101036020526040902080544391908390811061147e5761147e613189565b906000526020600020906003020160010154115b156114a5576114a2600183613536565b91505b806114af816131b5565b9150506113a4565b6114bf611c59565b610d2960006122bf565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060609880546108cf906131ce565b61151d610496611d62565b6115395760405162461bcd60e51b81526004016109ed90613202565b610aa0838383612311565b610c0b61154f611d62565b82610d2b565b610b52611560611d62565b83836123a9565b60ff546001600160a01b031690565b61157e611d62565b6001600160a01b031661158f6114c9565b6001600160a01b031614806115aa57506115aa610496611d62565b6115c65760405162461bcd60e51b81526004016109ed9061327a565b610c0b6000805160206137d283398151915282612085565b6115ef6115e9611d62565b83611e25565b61160b5760405162461bcd60e51b81526004016109ed9061322d565b61161784848484612473565b50505050565b606060006116296124a6565b9050611634836124b0565b156116895760008151116116575760405180602001604052806000815250611682565b80611661846124cd565b60405160200161167292919061357b565b6040516020818303038152906040525b9392505050565b60008151116116a75760405180602001604052806000815250611682565b8060405160200161167291906135aa565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561174757838290600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050815260200190600101906116f7565b505050509050919050565b60008061175d611567565b90506001600160a01b03811661177557600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d791906135c6565b91505090565b6117e5611d62565b6001600160a01b03166117f66114c9565b6001600160a01b031614806118115750611811610496611d62565b61182d5760405162461bcd60e51b81526004016109ed9061327a565b60fe610b528282613331565b61184282610b8e565b61184b81611fed565b610aa08383612085565b600054610100900460ff16158080156118755750600054600160ff909116105b806118965750611884306124e4565b158015611896575060005460ff166001145b6118f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109ed565b6000805460ff19166001179055801561191c576000805461ff0019166101001790555b6119246124f3565b61192c6124f3565b611936858561251a565b61193e61255a565b6119466124f3565b6119656000805160206137d2833981519152611960611d62565b611fe3565b61197d6000805160206137d283398151915287611fe3565b6119956000805160206137d283398151915288611fe3565b61199e836117dd565b61010082905561010180546001600160a01b0319166001600160a01b0388161790556119c8611d62565b6001600160a01b0316876001600160a01b0316146119e9576119e987611b72565b8015611a2f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611a6d57611a6d612a13565b604051908082528060200260200182016040528015611a96578160200160208202803683370190505b50905060005b6001600160a01b03841660009081526101036020526040902054811015611349576001600160a01b038416600090815261010360205260409020805482908110611ae857611ae8613189565b906000526020600020906003020160020154828281518110611b0c57611b0c613189565b602090810291909101015280611b21816131b5565b915050611a9c565b606060fe80546108cf906131ce565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff1680611682575061168282611384565b611b7a611c59565b6001600160a01b038116611bdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109ed565b610c0b816122bf565b60006001600160e01b03198216637965db0b60e01b14806106875750610687825b60006001600160e01b031982166380ac58cd60e01b1480611c3a57506001600160e01b03198216635b5e139f60e01b145b8061068757506301ffc9a760e01b6001600160e01b0319831614610687565b611c61611d62565b6001600160a01b0316611c726114c9565b6001600160a01b031614610d295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109ed565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611d5d5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b60448201526064016109ed565b919050565b6000610b1c612591565b611d75816124b0565b610c0b5760405162461bcd60e51b81526004016109ed90613549565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611dc682611350565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610aa08282613331565b600080611e3183611350565b9050806001600160a01b0316846001600160a01b03161480611e585750611e588185611b38565b80611e7c5750836001600160a01b0316611e7184610952565b6001600160a01b0316145b949350505050565b826001600160a01b0316611e9782611350565b6001600160a01b031614611ebd5760405162461bcd60e51b81526004016109ed906135e3565b6001600160a01b038216611f1f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109ed565b611f2c83838360016125bf565b826001600160a01b0316611f3f82611350565b6001600160a01b031614611f655760405162461bcd60e51b81526004016109ed906135e3565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184936000805160206137f283398151915291a4505050565b610b528282611ffe565b610c0b81611ff9611d62565b61262b565b61200882826114d8565b610b5257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612041611d62565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61208f82826114d8565b15610b5257600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191690556120c6611d62565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166121605760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109ed565b612169816124b0565b156121865760405162461bcd60e51b81526004016109ed90613628565b6121946000838360016125bf565b61219d816124b0565b156121ba5760405162461bcd60e51b81526004016109ed90613628565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291906000805160206137f2833981519152908290a45050565b600061221e82611350565b905061222e8160008460016125bf565b61223782611350565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a845282852080546000190190558785526099909352818420805490911690555192935084926000805160206137f2833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123615760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b60448201526064016109ed565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036124065760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016109ed565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61247e848484611e84565b61248a84848484612684565b6116175760405162461bcd60e51b81526004016109ed9061365e565b6060610b1c611b29565b6000806124bc836122a4565b6001600160a01b0316141592915050565b6060610687826124dc84612793565b6001016127fd565b6001600160a01b03163b151590565b600054610100900460ff16610d295760405162461bcd60e51b81526004016109ed906136b0565b600054610100900460ff166125415760405162461bcd60e51b81526004016109ed906136b0565b609761254d8382613331565b506098610aa08282613331565b600054610100900460ff166125815760405162461bcd60e51b81526004016109ed906136b0565b610d2961258c611d62565b6122bf565b6000601436108015906125a857506125a8336112dc565b156125ba575060131936013560601c90565b503390565b6001600160a01b03841615806125dc57506001600160a01b038316155b806125ed57506125ed610496611d62565b6126265760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b60448201526064016109ed565b611617565b61263582826114d8565b610b525761264281612998565b61264d8360206127fd565b60405160200161265e9291906136fb565b60408051601f198184030181529082905262461bcd60e51b82526109ed91600401612c70565b6000612698846001600160a01b03166124e4565b1561278857836001600160a01b031663150b7a026126b4611d62565b8786866040518563ffffffff1660e01b81526004016126d6949392919061376a565b6020604051808303816000875af1925050508015612711575060408051601f3d908101601f1916820190925261270e9181019061379d565b60015b61276e573d80801561273f576040519150601f19603f3d011682016040523d82523d6000602084013e612744565b606091505b5080516000036127665760405162461bcd60e51b81526004016109ed9061365e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e7c565b506001949350505050565b600080608083901c156127ab5760809290921c916010015b604083901c156127c05760409290921c916008015b602083901c156127d55760209290921c916004015b601083901c156127ea5760109290921c916002015b600883901c156106875760010192915050565b6060600061280c8360026132aa565b612817906002613536565b6001600160401b0381111561282e5761282e612a13565b6040519080825280601f01601f191660200182016040528015612858576020820181803683370190505b509050600360fc1b8160008151811061287357612873613189565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106128a2576128a2613189565b60200101906001600160f81b031916908160001a90535060006128c68460026132aa565b6128d1906001613536565b90505b6001811115612949576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061290557612905613189565b1a60f81b82828151811061291b5761291b613189565b60200101906001600160f81b031916908160001a90535060049490941c93612942816137ba565b90506128d4565b5083156116825760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109ed565b60606106876001600160a01b03831660146127fd565b6001600160e01b031981168114610c0b57600080fd5b6000602082840312156129d657600080fd5b8135611682816129ae565b6001600160a01b0381168114610c0b57600080fd5b600060208284031215612a0857600080fd5b8135611682816129e1565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612a5157612a51612a13565b604052919050565b60006001600160401b03831115612a7257612a72612a13565b612a85601f8401601f1916602001612a29565b9050828152838383011115612a9957600080fd5b828260208301376000602084830101529392505050565b600082601f830112612ac157600080fd5b61168283833560208501612a59565b60006001600160401b03821115612ae957612ae9612a13565b5060051b60200190565b600080600080600060a08688031215612b0b57600080fd5b85356001600160401b0380821115612b2257600080fd5b612b2e89838a01612ab0565b9650602091508188013581811115612b4557600080fd5b612b518a828b01612ab0565b965050604088013581811115612b6657600080fd5b612b728a828b01612ab0565b95505060608801359350608088013581811115612b8e57600080fd5b88019050601f81018913612ba157600080fd5b8035612bb4612baf82612ad0565b612a29565b81815260059190911b8201830190838101908b831115612bd357600080fd5b928401925b82841015612bfa578335612beb816129e1565b82529284019290840190612bd8565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612c3b578181015183820152602001612c23565b50506000910152565b60008151808452612c5c816020860160208601612c20565b601f01601f19169290920160200192915050565b6020815260006116826020830184612c44565b600060208284031215612c9557600080fd5b5035919050565b60008060408385031215612caf57600080fd5b8235612cba816129e1565b946020939093013593505050565b600080600060608486031215612cdd57600080fd5b8335612ce8816129e1565b95602085013595506040909401359392505050565b60008060408385031215612d1057600080fd5b8235915060208301356001600160401b03811115612d2d57600080fd5b610c5a85828601612ab0565b600080600060608486031215612d4e57600080fd5b8335612d59816129e1565b92506020840135612d69816129e1565b929592945050506040919091013590565b60008060408385031215612d8d57600080fd5b50508035926020909101359150565b60008060408385031215612daf57600080fd5b823591506020830135612dc1816129e1565b809150509250929050565b8415158152836020820152826040820152608060608201526000612df36080830184612c44565b9695505050505050565b60006020808385031215612e1057600080fd5b82356001600160401b03811115612e2657600080fd5b8301601f81018513612e3757600080fd5b8035612e45612baf82612ad0565b81815260059190911b82018301908381019087831115612e6457600080fd5b928401925b82841015612e8257833582529284019290840190612e69565b979650505050505050565b600080600060608486031215612ea257600080fd5b833592506020840135612d69816129e1565b8015158114610c0b57600080fd5b60008060408385031215612ed557600080fd5b8235612ee0816129e1565b91506020830135612dc181612eb4565b60008060008060808587031215612f0657600080fd5b8435612f11816129e1565b93506020850135612f21816129e1565b92506040850135915060608501356001600160401b03811115612f4357600080fd5b8501601f81018713612f5457600080fd5b612f6387823560208401612a59565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b82811015612fbb5781518051855286810151878601528501518585015260609093019290850190600101612f8c565b5091979650505050505050565b600060208284031215612fda57600080fd5b81356001600160401b03811115612ff057600080fd5b611e7c84828501612ab0565b60008060008060008060c0878903121561301557600080fd5b8635613020816129e1565b95506020870135613030816129e1565b945060408701356001600160401b038082111561304c57600080fd5b6130588a838b01612ab0565b9550606089013591508082111561306e57600080fd5b61307a8a838b01612ab0565b9450608089013591508082111561309057600080fd5b5061309d89828a01612ab0565b92505060a087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b818110156130e9578351835292840192918401916001016130cd565b50909695505050505050565b6000806040838503121561310857600080fd5b8235613113816129e1565b91506020830135612dc1816129e1565b6001600160a01b0387811682528616602082015260c06040820181905260009061314f90830187612c44565b82810360608401526131618187612c44565b905082810360808401526131758186612c44565b9150508260a0830152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131c7576131c761319f565b5060010190565b600181811c908216806131e257607f821691505b6020821081036116b857634e487b7160e01b600052602260045260246000fd5b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106875761068761319f565b6000826132de57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610aa057600081815260208120601f850160051c8101602086101561330a5750805b601f850160051c820191505b8181101561332957828155600101613316565b505050505050565b81516001600160401b0381111561334a5761334a612a13565b61335e8161335884546131ce565b846132e3565b602080601f831160018114613393576000841561337b5750858301515b600019600386901b1c1916600185901b178555613329565b600085815260208120601f198616915b828110156133c2578886015182559484019460019091019084016133a3565b50858210156133e05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906134309083016133f0565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612df360e083016133f0565b60006020828403121561349857600080fd5b815161168281612eb4565b818103818111156106875761068761319f565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906134309083016134b6565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612df360e083016134b6565b808201808211156106875761068761319f565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b6000835161358d818460208801612c20565b8351908301906135a1818360208801612c20565b01949350505050565b600082516135bc818460208701612c20565b9190910192915050565b6000602082840312156135d857600080fd5b8151611682816129e1565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161372d816017850160208801612c20565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161375e816028840160208801612c20565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612df390830184612c44565b6000602082840312156137af57600080fd5b8151611682816129ae565b6000816137c9576137c961319f565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220a892f03eeb5d59460e09404f0e0be3a62423dd433d9ace990e83915678c8144e64736f6c63430008110033", + "bytecode": "0x608060405234801561001057600080fd5b5061390d806100206000396000f3fe608060405234801561001057600080fd5b50600436106102675760003560e01c806301ffc9a71461026c57806302acb9a61461029457806305a14872146102a957806306fdde03146102c9578063081812fc146102de578063095ea7b3146102f1578063156e29f614610304578063162790551461031757806322e8e1e01461032b578063237c49191461034157806323b872dd14610354578063248a9ca31461036757806327ac0c581461037a5780632a55205a1461038d5780632f2ff15d146103bf57806336568abe146103d25780633d6d3598146103e557806340c10f19146103ed57806342842e0e1461040057806342966c681461041357806347c4ef2514610426578063572b6c05146104495780635ced058e1461045c5780635ea3ab851461046d5780636352211e146104805780636d70f7ae146104935780636fac889b146104a65780636fd902e1146104cd57806370a08231146104d3578063715018a6146104e657806382c947b7146104ee57806385be5724146105085780638da5cb5b1461051d57806391d148541461052557806395d89b41146105385780639713c80714610540578063a0712d6814610553578063a217fddf14610566578063a22cb4651461056e578063ab9de23014610581578063b219f7d714610589578063b88d4fde1461059c578063c87b56dd146105af578063cbd5a40e146105c2578063ce1b815f146105e2578063d2423105146105ea578063d547741f146105fd578063ded96d4814610610578063e271d9ee14610623578063e8a3d48514610643578063e985e9c51461064b578063e9c1e0451461065e578063f2fde38b14610671575b600080fd5b61027f61027a366004612a92565b610684565b60405190151581526020015b60405180910390f35b6102a76102a2366004612ac4565b6106bf565b005b6102bc6102b7366004612bc1565b6106e9565b60405161028b9190612cda565b6102d16108f2565b60405161028b9190612d3e565b6102bc6102ec366004612d51565b610984565b6102a76102ff366004612d6a565b6109ab565b6102a7610312366004612d96565b610ad7565b61027f610325366004612ac4565b3b151590565b610333610b6e565b60405190815260200161028b565b6102a761034f366004612dcb565b610b7f565b6102a7610362366004612e07565b610bb4565b610333610375366004612d51565b610bec565b6102a7610388366004612ac4565b610c01565b6103a061039b366004612e48565b610c6c565b604080516001600160a01b03909316835260208301919091520161028b565b6102a76103cd366004612e6a565b610cc2565b6102a76103e0366004612e6a565b610cde565b6102a7610d68565b6102a76103fb366004612d6a565b610d89565b6102a761040e366004612e07565b610f84565b6102a7610421366004612d51565b610f9f565b610439610434366004612d51565b61123d565b60405161028b9493929190612e9a565b61027f610457366004612ac4565b61133a565b6102bc61046a366004612d51565b90565b61033361047b366004612ecb565b61135f565b6102bc61048e366004612d51565b6113ae565b61027f6104a1366004612ac4565b6113e2565b6103337f3cf8e80a7a55dd870201fe38c468fe694473dbe8d59a63381f1da07dc1c2b65581565b43610333565b6103336104e1366004612ac4565b6113fc565b6102a7611515565b6103336104fc366004612ac4565b6001600160a01b031690565b61033360008051602061389883398151915281565b6102bc611527565b61027f610533366004612e6a565b611536565b6102d1611561565b6102a761054e366004612f5b565b611570565b6102a7610561366004612d51565b6115a2565b610333600081565b6102a761057c366004612f90565b6115b3565b6102bc6115c5565b6102a7610597366004612ac4565b6115d4565b6102a76105aa366004612fbe565b61163c565b6102d16105bd366004612d51565b61167b565b6105d56105d0366004612ac4565b61171c565b60405161028b919061303d565b6102bc6117b0565b6102a76105f8366004613096565b61183b565b6102a761060b366004612e6a565b611897565b6102a761061e3660046130ca565b6118b3565b610636610631366004612ac4565b6119d7565b60405161028b919061317f565b6102d1611ac8565b61027f6106593660046131c3565b611ad7565b60ff546102bc906001600160a01b031681565b6102a761067f366004612ac4565b611b11565b600061068f82611b87565b8061069e575061069e82611ba8565b806106b957506001600160e01b0319821663152a902d60e11b145b92915050565b6106c7611bf8565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b03168061071f5750305b600061072a82611c67565b9050806001600160a01b03811663ded96d48610744611d01565b610101546040516001600160e01b031960e085901b16815261077b92916001600160a01b0316908e908e908e908e906004016131f1565b600060405180830381600087803b15801561079557600080fd5b505af11580156107a9573d6000803e3d6000fd5b5050505060005b855181101561084357816001600160a01b03166327ac0c588783815181106107da576107da613257565b60200260200101516040518263ffffffff1660e01b81526004016107fe9190612cda565b600060405180830381600087803b15801561081857600080fd5b505af115801561082c573d6000803e3d6000fd5b50505050808061083b90613283565b9150506107b0565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d16040516108de91815260200190565b60405180910390a350979650505050505050565b6060609780546109019061329c565b80601f016020809104026020016040519081016040528092919081815260200182805461092d9061329c565b801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050905090565b600061098f82611d0b565b506000908152609b60205260409020546001600160a01b031690565b60006109b6826113ae565b9050806001600160a01b0316836001600160a01b031603610a285760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a3a611d01565b6001600160a01b03161480610a565750610a5681610659611d01565b610ac85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610a1f565b610ad28383611d30565b505050565b610ae18383610d89565b600160fc60008481526020019081526020016000206001016000828254610b0891906132d0565b90915550506001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610b7a6101025490565b905090565b610b8a6104a1611d01565b610ba65760405162461bcd60e51b8152600401610a1f906132e3565b610bb08282611d9e565b5050565b610bc5610bbf611d01565b82611dc4565b610be15760405162461bcd60e51b8152600401610a1f9061330e565b610ad2838383611e23565b600090815260c9602052604090206001015490565b610c09611d01565b6001600160a01b0316610c1a611527565b6001600160a01b03161480610c355750610c356104a1611d01565b610c515760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282611f82565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610cae908661338b565b610cb891906133a2565b9150509250929050565b610ccb82610bec565b610cd481611f8c565b610ad28383611f9d565b610ce6611d01565b6001600160a01b0316816001600160a01b031614610d5e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a1f565b610bb08282612024565b610d87600080516020613898833981519152610d82611d01565b612024565b565b610d946104a1611d01565b80610db75750610da2611527565b6001600160a01b0316826001600160a01b0316145b610e005760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b6044820152606401610a1f565b610100541580610e1557506101005461010254105b610e565760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b6044820152606401610a1f565b610e6561010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610ea2908261340a565b50610101546001600160a01b031663bb794d9282610ebe611d01565b600143604051602001610ed494939291906134e0565b604051602081830303815290604052805190602001208360001b610ef6611d01565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b8152600401610f36949392919061351f565b6020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f79919061355f565b50610bb082826120a9565b610ad28383836040518060200160405280600081525061163c565b610faa6104a1611d01565b80610fd55750610fb8611d01565b6001600160a01b0316610fca826113ae565b6001600160a01b0316145b6110395760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b6064820152608401610a1f565b600160fc60008381526020019081526020016000206001016000828254611060919061357c565b9091555050610101546001600160a01b031663bb794d9282611080611d01565b60014360405160200161109694939291906135a6565b604051602081830303815290604052805190602001208360001b6110b8611d01565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b81526004016110f894939291906135cf565b6020604051808303816000875af1158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b919061355f565b50611145816121b2565b60005b6101036000611155611d01565b6001600160a01b03168152602081019190915260400160002054811015610bb057816101036000611184611d01565b6001600160a01b03166001600160a01b0316815260200190815260200160002082815481106111b5576111b5613257565b9060005260206000209060030201600001540361122b5761010360006111d9611d01565b6001600160a01b03166001600160a01b03168152602001908152602001600020818154811061120a5761120a613257565b60009182526020822060039091020181815560018101829055600201555050565b8061123581613283565b915050611148565b600081815260fc602090815260408083208151608081018352815460ff161515815260018201549381019390935260028101549183019190915260038101805484938493606093859383860191906112949061329c565b80601f01602080910402602001604051908101604052809291908181526020018280546112c09061329c565b801561130d5780601f106112e25761010080835404028352916020019161130d565b820191906000526020600020905b8154815290600101906020018083116112f057829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b60006113446117b0565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156113a75783818151811061138057611380613257565b60200260200101518261139391906132d0565b91508061139f81613283565b915050611365565b5092915050565b6000806113ba83612243565b90506001600160a01b0381166106b95760405162461bcd60e51b8152600401610a1f9061360f565b60006106b960008051602061389883398151915283611536565b60008060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b03841660009081526101036020526040812080548390811061144e5761144e613257565b9060005260206000209060030201600201541180156114f057506001600160a01b03841660009081526101036020526040902080548290811061149357611493613257565b906000526020600020906003020160010154600014806114f057506001600160a01b0384166000908152610103602052604090208054439190839081106114dc576114dc613257565b906000526020600020906003020160010154115b15611503576115006001836132d0565b91505b8061150d81613283565b915050611402565b61151d611bf8565b610d87600061225e565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060609880546109019061329c565b61157b6104a1611d01565b6115975760405162461bcd60e51b8152600401610a1f906132e3565b610ad28383836122b0565b610c696115ad611d01565b82610d89565b610bb06115be611d01565b8383612348565b60ff546001600160a01b031690565b6115dc611d01565b6001600160a01b03166115ed611527565b6001600160a01b0316148061160857506116086104a1611d01565b6116245760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282612024565b61164d611647611d01565b83611dc4565b6116695760405162461bcd60e51b8152600401610a1f9061330e565b61167584848484612412565b50505050565b60606000611687612445565b90506116928361244f565b156116e75760008151116116b557604051806020016040528060008152506116e0565b806116bf8461246c565b6040516020016116d0929190613641565b6040516020818303038152906040525b9392505050565b600081511161170557604051806020016040528060008152506116e0565b806040516020016116d09190613670565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b828210156117a55783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611755565b505050509050919050565b6000806117bb6115c5565b90506001600160a01b0381166117d357600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611835919061368c565b91505090565b611843611d01565b6001600160a01b0316611854611527565b6001600160a01b0316148061186f575061186f6104a1611d01565b61188b5760405162461bcd60e51b8152600401610a1f9061335b565b60fe610bb0828261340a565b6118a082610bec565b6118a981611f8c565b610ad28383612024565b600054610100900460ff16158080156118d35750600054600160ff909116105b806118f457506118e230612483565b1580156118f4575060005460ff166001145b6119575760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a1f565b6000805460ff19166001179055801561197a576000805461ff0019166101001790555b611988878787878787612492565b80156119ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611a0c57611a0c612ae1565b604051908082528060200260200182016040528015611a35578160200160208202803683370190505b50905060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b038416600090815261010360205260409020805482908110611a8757611a87613257565b906000526020600020906003020160020154828281518110611aab57611aab613257565b602090810291909101015280611ac081613283565b915050611a3b565b606060fe80546109019061329c565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff16806116e057506116e0826113e2565b611b19611bf8565b6001600160a01b038116611b7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a1f565b610c698161225e565b60006001600160e01b03198216637965db0b60e01b14806106b957506106b9825b60006001600160e01b031982166380ac58cd60e01b1480611bd957506001600160e01b03198216635b5e139f60e01b145b806106b957506301ffc9a760e01b6001600160e01b03198316146106b9565b611c00611d01565b6001600160a01b0316611c11611527565b6001600160a01b031614610d875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1f565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611cfc5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610a1f565b919050565b6000610b7a6124f7565b611d148161244f565b610c695760405162461bcd60e51b8152600401610a1f9061360f565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d65826113ae565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610ad2828261340a565b600080611dd0836113ae565b9050806001600160a01b0316846001600160a01b03161480611df75750611df78185611ad7565b80611e1b5750836001600160a01b0316611e1084610984565b6001600160a01b0316145b949350505050565b826001600160a01b0316611e36826113ae565b6001600160a01b031614611e5c5760405162461bcd60e51b8152600401610a1f906136a9565b6001600160a01b038216611ebe5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a1f565b611ecb8383836001612525565b826001600160a01b0316611ede826113ae565b6001600160a01b031614611f045760405162461bcd60e51b8152600401610a1f906136a9565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184936000805160206138b883398151915291a4505050565b610bb08282611f9d565b610c6981611f98611d01565b612591565b611fa78282611536565b610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fe0611d01565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61202e8282611536565b15610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19169055612065611d01565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166120ff5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a1f565b6121088161244f565b156121255760405162461bcd60e51b8152600401610a1f906136ee565b612133600083836001612525565b61213c8161244f565b156121595760405162461bcd60e51b8152600401610a1f906136ee565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291906000805160206138b8833981519152908290a45050565b60006121bd826113ae565b90506121cd816000846001612525565b6121d6826113ae565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a845282852080546000190190558785526099909352818420805490911690555192935084926000805160206138b8833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123005760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610a1f565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036123a55760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610a1f565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61241d848484611e23565b612429848484846125ea565b6116755760405162461bcd60e51b8152600401610a1f90613724565b6060610b7a611ac8565b60008061245b83612243565b6001600160a01b0316141592915050565b60606106b98261247b846126f9565b600101612763565b6001600160a01b03163b151590565b600054610100900460ff166124b95760405162461bcd60e51b8152600401610a1f90613776565b6124c16128fe565b6124c96128fe565b6124d38484612925565b6124db612965565b6124e36128fe565b6124ef8686848461299c565b505050505050565b60006014361080159061250e575061250e3361133a565b15612520575060131936013560601c90565b503390565b6001600160a01b038416158061254257506001600160a01b038316155b8061255357506125536104a1611d01565b61258c5760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610a1f565b611675565b61259b8282611536565b610bb0576125a881612a66565b6125b3836020612763565b6040516020016125c49291906137c1565b60408051601f198184030181529082905262461bcd60e51b8252610a1f91600401612d3e565b60006125fe846001600160a01b0316612483565b156126ee57836001600160a01b031663150b7a0261261a611d01565b8786866040518563ffffffff1660e01b815260040161263c9493929190613830565b6020604051808303816000875af1925050508015612677575060408051601f3d908101601f1916820190925261267491810190613863565b60015b6126d4573d8080156126a5576040519150601f19603f3d011682016040523d82523d6000602084013e6126aa565b606091505b5080516000036126cc5760405162461bcd60e51b8152600401610a1f90613724565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e1b565b506001949350505050565b600080608083901c156127115760809290921c916010015b604083901c156127265760409290921c916008015b602083901c1561273b5760209290921c916004015b601083901c156127505760109290921c916002015b600883901c156106b95760010192915050565b6060600061277283600261338b565b61277d9060026132d0565b6001600160401b0381111561279457612794612ae1565b6040519080825280601f01601f1916602001820160405280156127be576020820181803683370190505b509050600360fc1b816000815181106127d9576127d9613257565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061280857612808613257565b60200101906001600160f81b031916908160001a905350600061282c84600261338b565b6128379060016132d0565b90505b60018111156128af576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061286b5761286b613257565b1a60f81b82828151811061288157612881613257565b60200101906001600160f81b031916908160001a90535060049490941c936128a881613880565b905061283a565b5083156116e05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a1f565b600054610100900460ff16610d875760405162461bcd60e51b8152600401610a1f90613776565b600054610100900460ff1661294c5760405162461bcd60e51b8152600401610a1f90613776565b6097612958838261340a565b506098610ad2828261340a565b600054610100900460ff1661298c5760405162461bcd60e51b8152600401610a1f90613776565b610d87612997611d01565b61225e565b600054610100900460ff166129c35760405162461bcd60e51b8152600401610a1f90613776565b6129e26000805160206138988339815191526129dd611d01565b611f82565b6129fa60008051602061389883398151915284611f82565b612a1260008051602061389883398151915285611f82565b612a1b8261183b565b61010081905561010180546001600160a01b0319166001600160a01b038516179055612a45611d01565b6001600160a01b0316846001600160a01b0316146116755761167584611b11565b60606106b96001600160a01b0383166014612763565b6001600160e01b031981168114610c6957600080fd5b600060208284031215612aa457600080fd5b81356116e081612a7c565b6001600160a01b0381168114610c6957600080fd5b600060208284031215612ad657600080fd5b81356116e081612aaf565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612b1f57612b1f612ae1565b604052919050565b60006001600160401b03831115612b4057612b40612ae1565b612b53601f8401601f1916602001612af7565b9050828152838383011115612b6757600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b8f57600080fd5b6116e083833560208501612b27565b60006001600160401b03821115612bb757612bb7612ae1565b5060051b60200190565b600080600080600060a08688031215612bd957600080fd5b85356001600160401b0380821115612bf057600080fd5b612bfc89838a01612b7e565b9650602091508188013581811115612c1357600080fd5b612c1f8a828b01612b7e565b965050604088013581811115612c3457600080fd5b612c408a828b01612b7e565b95505060608801359350608088013581811115612c5c57600080fd5b88019050601f81018913612c6f57600080fd5b8035612c82612c7d82612b9e565b612af7565b81815260059190911b8201830190838101908b831115612ca157600080fd5b928401925b82841015612cc8578335612cb981612aaf565b82529284019290840190612ca6565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612d09578181015183820152602001612cf1565b50506000910152565b60008151808452612d2a816020860160208601612cee565b601f01601f19169290920160200192915050565b6020815260006116e06020830184612d12565b600060208284031215612d6357600080fd5b5035919050565b60008060408385031215612d7d57600080fd5b8235612d8881612aaf565b946020939093013593505050565b600080600060608486031215612dab57600080fd5b8335612db681612aaf565b95602085013595506040909401359392505050565b60008060408385031215612dde57600080fd5b8235915060208301356001600160401b03811115612dfb57600080fd5b610cb885828601612b7e565b600080600060608486031215612e1c57600080fd5b8335612e2781612aaf565b92506020840135612e3781612aaf565b929592945050506040919091013590565b60008060408385031215612e5b57600080fd5b50508035926020909101359150565b60008060408385031215612e7d57600080fd5b823591506020830135612e8f81612aaf565b809150509250929050565b8415158152836020820152826040820152608060608201526000612ec16080830184612d12565b9695505050505050565b60006020808385031215612ede57600080fd5b82356001600160401b03811115612ef457600080fd5b8301601f81018513612f0557600080fd5b8035612f13612c7d82612b9e565b81815260059190911b82018301908381019087831115612f3257600080fd5b928401925b82841015612f5057833582529284019290840190612f37565b979650505050505050565b600080600060608486031215612f7057600080fd5b833592506020840135612e3781612aaf565b8015158114610c6957600080fd5b60008060408385031215612fa357600080fd5b8235612fae81612aaf565b91506020830135612e8f81612f82565b60008060008060808587031215612fd457600080fd5b8435612fdf81612aaf565b93506020850135612fef81612aaf565b92506040850135915060608501356001600160401b0381111561301157600080fd5b8501601f8101871361302257600080fd5b61303187823560208401612b27565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b82811015613089578151805185528681015187860152850151858501526060909301929085019060010161305a565b5091979650505050505050565b6000602082840312156130a857600080fd5b81356001600160401b038111156130be57600080fd5b611e1b84828501612b7e565b60008060008060008060c087890312156130e357600080fd5b86356130ee81612aaf565b955060208701356130fe81612aaf565b945060408701356001600160401b038082111561311a57600080fd5b6131268a838b01612b7e565b9550606089013591508082111561313c57600080fd5b6131488a838b01612b7e565b9450608089013591508082111561315e57600080fd5b5061316b89828a01612b7e565b92505060a087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b818110156131b75783518352928401929184019160010161319b565b50909695505050505050565b600080604083850312156131d657600080fd5b82356131e181612aaf565b91506020830135612e8f81612aaf565b6001600160a01b0387811682528616602082015260c06040820181905260009061321d90830187612d12565b828103606084015261322f8187612d12565b905082810360808401526132438186612d12565b9150508260a0830152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016132955761329561326d565b5060010190565b600181811c908216806132b057607f821691505b60208210810361171657634e487b7160e01b600052602260045260246000fd5b808201808211156106b9576106b961326d565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106b9576106b961326d565b6000826133bf57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610ad257600081815260208120601f850160051c810160208610156133eb5750805b601f850160051c820191505b818110156124ef578281556001016133f7565b81516001600160401b0381111561342357613423612ae1565b61343781613431845461329c565b846133c4565b602080601f83116001811461346c57600084156134545750858301515b600019600386901b1c1916600185901b1785556124ef565b600085815260208120601f198616915b8281101561349b5788860151825594840194600190910190840161347c565b50858210156134b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906135099083016134c9565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e083016134c9565b60006020828403121561357157600080fd5b81516116e081612f82565b818103818111156106b9576106b961326d565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a06040820181905260009061350990830161358f565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e0830161358f565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351613653818460208801612cee565b835190830190613667818360208801612cee565b01949350505050565b60008251613682818460208701612cee565b9190910192915050565b60006020828403121561369e57600080fd5b81516116e081612aaf565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516137f3816017850160208801612cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613824816028840160208801612cee565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ec190830184612d12565b60006020828403121561387557600080fd5b81516116e081612a7c565b60008161388f5761388f61326d565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122058d193dc4a89936faa0836b7c3c9846ab4945e4f6b027433eff0c9a6b5fe9f9a64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102675760003560e01c806301ffc9a71461026c57806302acb9a61461029457806305a14872146102a957806306fdde03146102c9578063081812fc146102de578063095ea7b3146102f1578063156e29f614610304578063162790551461031757806322e8e1e01461032b578063237c49191461034157806323b872dd14610354578063248a9ca31461036757806327ac0c581461037a5780632a55205a1461038d5780632f2ff15d146103bf57806336568abe146103d25780633d6d3598146103e557806340c10f19146103ed57806342842e0e1461040057806342966c681461041357806347c4ef2514610426578063572b6c05146104495780635ced058e1461045c5780635ea3ab851461046d5780636352211e146104805780636d70f7ae146104935780636fac889b146104a65780636fd902e1146104cd57806370a08231146104d3578063715018a6146104e657806382c947b7146104ee57806385be5724146105085780638da5cb5b1461051d57806391d148541461052557806395d89b41146105385780639713c80714610540578063a0712d6814610553578063a217fddf14610566578063a22cb4651461056e578063ab9de23014610581578063b219f7d714610589578063b88d4fde1461059c578063c87b56dd146105af578063cbd5a40e146105c2578063ce1b815f146105e2578063d2423105146105ea578063d547741f146105fd578063ded96d4814610610578063e271d9ee14610623578063e8a3d48514610643578063e985e9c51461064b578063e9c1e0451461065e578063f2fde38b14610671575b600080fd5b61027f61027a366004612a92565b610684565b60405190151581526020015b60405180910390f35b6102a76102a2366004612ac4565b6106bf565b005b6102bc6102b7366004612bc1565b6106e9565b60405161028b9190612cda565b6102d16108f2565b60405161028b9190612d3e565b6102bc6102ec366004612d51565b610984565b6102a76102ff366004612d6a565b6109ab565b6102a7610312366004612d96565b610ad7565b61027f610325366004612ac4565b3b151590565b610333610b6e565b60405190815260200161028b565b6102a761034f366004612dcb565b610b7f565b6102a7610362366004612e07565b610bb4565b610333610375366004612d51565b610bec565b6102a7610388366004612ac4565b610c01565b6103a061039b366004612e48565b610c6c565b604080516001600160a01b03909316835260208301919091520161028b565b6102a76103cd366004612e6a565b610cc2565b6102a76103e0366004612e6a565b610cde565b6102a7610d68565b6102a76103fb366004612d6a565b610d89565b6102a761040e366004612e07565b610f84565b6102a7610421366004612d51565b610f9f565b610439610434366004612d51565b61123d565b60405161028b9493929190612e9a565b61027f610457366004612ac4565b61133a565b6102bc61046a366004612d51565b90565b61033361047b366004612ecb565b61135f565b6102bc61048e366004612d51565b6113ae565b61027f6104a1366004612ac4565b6113e2565b6103337f3cf8e80a7a55dd870201fe38c468fe694473dbe8d59a63381f1da07dc1c2b65581565b43610333565b6103336104e1366004612ac4565b6113fc565b6102a7611515565b6103336104fc366004612ac4565b6001600160a01b031690565b61033360008051602061389883398151915281565b6102bc611527565b61027f610533366004612e6a565b611536565b6102d1611561565b6102a761054e366004612f5b565b611570565b6102a7610561366004612d51565b6115a2565b610333600081565b6102a761057c366004612f90565b6115b3565b6102bc6115c5565b6102a7610597366004612ac4565b6115d4565b6102a76105aa366004612fbe565b61163c565b6102d16105bd366004612d51565b61167b565b6105d56105d0366004612ac4565b61171c565b60405161028b919061303d565b6102bc6117b0565b6102a76105f8366004613096565b61183b565b6102a761060b366004612e6a565b611897565b6102a761061e3660046130ca565b6118b3565b610636610631366004612ac4565b6119d7565b60405161028b919061317f565b6102d1611ac8565b61027f6106593660046131c3565b611ad7565b60ff546102bc906001600160a01b031681565b6102a761067f366004612ac4565b611b11565b600061068f82611b87565b8061069e575061069e82611ba8565b806106b957506001600160e01b0319821663152a902d60e11b145b92915050565b6106c7611bf8565b60ff80546001600160a01b0319166001600160a01b0392909216919091179055565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000906001600160a01b03168061071f5750305b600061072a82611c67565b9050806001600160a01b03811663ded96d48610744611d01565b610101546040516001600160e01b031960e085901b16815261077b92916001600160a01b0316908e908e908e908e906004016131f1565b600060405180830381600087803b15801561079557600080fd5b505af11580156107a9573d6000803e3d6000fd5b5050505060005b855181101561084357816001600160a01b03166327ac0c588783815181106107da576107da613257565b60200260200101516040518263ffffffff1660e01b81526004016107fe9190612cda565b600060405180830381600087803b15801561081857600080fd5b505af115801561082c573d6000803e3d6000fd5b50505050808061083b90613283565b9150506107b0565b50806001600160a01b0316633d6d35986040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b03167f60b02f0439b830955522ba890ebaeed1012ac175aba5742b6032a7b79d0cd7346102d16040516108de91815260200190565b60405180910390a350979650505050505050565b6060609780546109019061329c565b80601f016020809104026020016040519081016040528092919081815260200182805461092d9061329c565b801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b5050505050905090565b600061098f82611d0b565b506000908152609b60205260409020546001600160a01b031690565b60006109b6826113ae565b9050806001600160a01b0316836001600160a01b031603610a285760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b0316610a3a611d01565b6001600160a01b03161480610a565750610a5681610659611d01565b610ac85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610a1f565b610ad28383611d30565b505050565b610ae18383610d89565b600160fc60008481526020019081526020016000206001016000828254610b0891906132d0565b90915550506001600160a01b03909216600090815261010360209081526040808320815160608101835294855284830195865243918501918252805460018181018355918552929093209351600390920290930190815592519083015551600290910155565b6000610b7a6101025490565b905090565b610b8a6104a1611d01565b610ba65760405162461bcd60e51b8152600401610a1f906132e3565b610bb08282611d9e565b5050565b610bc5610bbf611d01565b82611dc4565b610be15760405162461bcd60e51b8152600401610a1f9061330e565b610ad2838383611e23565b600090815260c9602052604090206001015490565b610c09611d01565b6001600160a01b0316610c1a611527565b6001600160a01b03161480610c355750610c356104a1611d01565b610c515760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282611f82565b50565b600082815260fb60209081526040808320815180830190925280546001600160a01b03168083526001909101549282018390529291606490610cae908661338b565b610cb891906133a2565b9150509250929050565b610ccb82610bec565b610cd481611f8c565b610ad28383611f9d565b610ce6611d01565b6001600160a01b0316816001600160a01b031614610d5e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a1f565b610bb08282612024565b610d87600080516020613898833981519152610d82611d01565b612024565b565b610d946104a1611d01565b80610db75750610da2611527565b6001600160a01b0316826001600160a01b0316145b610e005760405162461bcd60e51b815260206004820152601a6024820152791bdb9b1e481b999d081bdc195c985d1bdc8818d85b881b5a5b9d60321b6044820152606401610a1f565b610100541580610e1557506101005461010254105b610e565760405162461bcd60e51b8152602060048201526012602482015271115490cdcc8c4e8810d85c08195e18d9595960721b6044820152606401610a1f565b610e6561010280546001019055565b61010254600082815260fc60208181526040808420600181019590955580518083019091528381529285905252600390910190610ea2908261340a565b50610101546001600160a01b031663bb794d9282610ebe611d01565b600143604051602001610ed494939291906134e0565b604051602081830303815290604052805190602001208360001b610ef6611d01565b7fdaf0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a727345503546040518563ffffffff1660e01b8152600401610f36949392919061351f565b6020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f79919061355f565b50610bb082826120a9565b610ad28383836040518060200160405280600081525061163c565b610faa6104a1611d01565b80610fd55750610fb8611d01565b6001600160a01b0316610fca826113ae565b6001600160a01b0316145b6110395760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a2063616c6c6572206973206e6f74206f776e6572206f72206e60448201526e6f7420686176652062616c616e636560881b6064820152608401610a1f565b600160fc60008381526020019081526020016000206001016000828254611060919061357c565b9091555050610101546001600160a01b031663bb794d9282611080611d01565b60014360405160200161109694939291906135a6565b604051602081830303815290604052805190602001208360001b6110b8611d01565b7ff43e8cfd4725c1e28fa4a6e3e468b4fcf75367166b850ac5f04e33ec843e82c16040518563ffffffff1660e01b81526004016110f894939291906135cf565b6020604051808303816000875af1158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b919061355f565b50611145816121b2565b60005b6101036000611155611d01565b6001600160a01b03168152602081019190915260400160002054811015610bb057816101036000611184611d01565b6001600160a01b03166001600160a01b0316815260200190815260200160002082815481106111b5576111b5613257565b9060005260206000209060030201600001540361122b5761010360006111d9611d01565b6001600160a01b03166001600160a01b03168152602001908152602001600020818154811061120a5761120a613257565b60009182526020822060039091020181815560018101829055600201555050565b8061123581613283565b915050611148565b600081815260fc602090815260408083208151608081018352815460ff161515815260018201549381019390935260028101549183019190915260038101805484938493606093859383860191906112949061329c565b80601f01602080910402602001604051908101604052809291908181526020018280546112c09061329c565b801561130d5780601f106112e25761010080835404028352916020019161130d565b820191906000526020600020905b8154815290600101906020018083116112f057829003601f168201915b505050919092525050815160208301516040840151606090940151919a9099509297509550909350505050565b60006113446117b0565b6001600160a01b0316826001600160a01b0316149050919050565b60008060005b83518110156113a75783818151811061138057611380613257565b60200260200101518261139391906132d0565b91508061139f81613283565b915050611365565b5092915050565b6000806113ba83612243565b90506001600160a01b0381166106b95760405162461bcd60e51b8152600401610a1f9061360f565b60006106b960008051602061389883398151915283611536565b60008060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b03841660009081526101036020526040812080548390811061144e5761144e613257565b9060005260206000209060030201600201541180156114f057506001600160a01b03841660009081526101036020526040902080548290811061149357611493613257565b906000526020600020906003020160010154600014806114f057506001600160a01b0384166000908152610103602052604090208054439190839081106114dc576114dc613257565b906000526020600020906003020160010154115b15611503576115006001836132d0565b91505b8061150d81613283565b915050611402565b61151d611bf8565b610d87600061225e565b6033546001600160a01b031690565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060609880546109019061329c565b61157b6104a1611d01565b6115975760405162461bcd60e51b8152600401610a1f906132e3565b610ad28383836122b0565b610c696115ad611d01565b82610d89565b610bb06115be611d01565b8383612348565b60ff546001600160a01b031690565b6115dc611d01565b6001600160a01b03166115ed611527565b6001600160a01b0316148061160857506116086104a1611d01565b6116245760405162461bcd60e51b8152600401610a1f9061335b565b610c6960008051602061389883398151915282612024565b61164d611647611d01565b83611dc4565b6116695760405162461bcd60e51b8152600401610a1f9061330e565b61167584848484612412565b50505050565b60606000611687612445565b90506116928361244f565b156116e75760008151116116b557604051806020016040528060008152506116e0565b806116bf8461246c565b6040516020016116d0929190613641565b6040516020818303038152906040525b9392505050565b600081511161170557604051806020016040528060008152506116e0565b806040516020016116d09190613670565b50919050565b6001600160a01b038116600090815261010360209081526040808320805482518185028101850190935280835260609492939192909184015b828210156117a55783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190611755565b505050509050919050565b6000806117bb6115c5565b90506001600160a01b0381166117d357600091505090565b806001600160a01b031663ce1b815f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611835919061368c565b91505090565b611843611d01565b6001600160a01b0316611854611527565b6001600160a01b0316148061186f575061186f6104a1611d01565b61188b5760405162461bcd60e51b8152600401610a1f9061335b565b60fe610bb0828261340a565b6118a082610bec565b6118a981611f8c565b610ad28383612024565b600054610100900460ff16158080156118d35750600054600160ff909116105b806118f457506118e230612483565b1580156118f4575060005460ff166001145b6119575760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a1f565b6000805460ff19166001179055801561197a576000805461ff0019166101001790555b611988878787878787612492565b80156119ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6001600160a01b03811660009081526101036020526040812054606091906001600160401b03811115611a0c57611a0c612ae1565b604051908082528060200260200182016040528015611a35578160200160208202803683370190505b50905060005b6001600160a01b038416600090815261010360205260409020548110156113a7576001600160a01b038416600090815261010360205260409020805482908110611a8757611a87613257565b906000526020600020906003020160020154828281518110611aab57611aab613257565b602090810291909101015280611ac081613283565b915050611a3b565b606060fe80546109019061329c565b6001600160a01b038083166000908152609c6020908152604080832093851683529290529081205460ff16806116e057506116e0826113e2565b611b19611bf8565b6001600160a01b038116611b7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a1f565b610c698161225e565b60006001600160e01b03198216637965db0b60e01b14806106b957506106b9825b60006001600160e01b031982166380ac58cd60e01b1480611bd957506001600160e01b03198216635b5e139f60e01b145b806106b957506301ffc9a760e01b6001600160e01b03198316146106b9565b611c00611d01565b6001600160a01b0316611c11611527565b6001600160a01b031614610d875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1f565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116611cfc5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b6044820152606401610a1f565b919050565b6000610b7a6124f7565b611d148161244f565b610c695760405162461bcd60e51b8152600401610a1f9061360f565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d65826113ae565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260fc60205260409020805460ff19166001178155600301610ad2828261340a565b600080611dd0836113ae565b9050806001600160a01b0316846001600160a01b03161480611df75750611df78185611ad7565b80611e1b5750836001600160a01b0316611e1084610984565b6001600160a01b0316145b949350505050565b826001600160a01b0316611e36826113ae565b6001600160a01b031614611e5c5760405162461bcd60e51b8152600401610a1f906136a9565b6001600160a01b038216611ebe5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a1f565b611ecb8383836001612525565b826001600160a01b0316611ede826113ae565b6001600160a01b031614611f045760405162461bcd60e51b8152600401610a1f906136a9565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184936000805160206138b883398151915291a4505050565b610bb08282611f9d565b610c6981611f98611d01565b612591565b611fa78282611536565b610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fe0611d01565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61202e8282611536565b15610bb057600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19169055612065611d01565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b0382166120ff5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a1f565b6121088161244f565b156121255760405162461bcd60e51b8152600401610a1f906136ee565b612133600083836001612525565b61213c8161244f565b156121595760405162461bcd60e51b8152600401610a1f906136ee565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291906000805160206138b8833981519152908290a45050565b60006121bd826113ae565b90506121cd816000846001612525565b6121d6826113ae565b6000838152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552609a845282852080546000190190558785526099909352818420805490911690555192935084926000805160206138b8833981519152908390a45050565b6000908152609960205260409020546001600160a01b031690565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620f42408111156123005760405162461bcd60e51b815260206004820152601a60248201527908aa48664727062a4def2c2d8e8d2cae67440a8dede40d0d2ced60331b6044820152606401610a1f565b6040805180820182526001600160a01b0393841681526020808201938452600095865260fb90529320925183546001600160a01b031916921691909117825551600190910155565b816001600160a01b0316836001600160a01b0316036123a55760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610a1f565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61241d848484611e23565b612429848484846125ea565b6116755760405162461bcd60e51b8152600401610a1f90613724565b6060610b7a611ac8565b60008061245b83612243565b6001600160a01b0316141592915050565b60606106b98261247b846126f9565b600101612763565b6001600160a01b03163b151590565b600054610100900460ff166124b95760405162461bcd60e51b8152600401610a1f90613776565b6124c16128fe565b6124c96128fe565b6124d38484612925565b6124db612965565b6124e36128fe565b6124ef8686848461299c565b505050505050565b60006014361080159061250e575061250e3361133a565b15612520575060131936013560601c90565b503390565b6001600160a01b038416158061254257506001600160a01b038316155b8061255357506125536104a1611d01565b61258c5760405162461bcd60e51b815260206004820152600a6024820152696f6e6c792070726f787960b01b6044820152606401610a1f565b611675565b61259b8282611536565b610bb0576125a881612a66565b6125b3836020612763565b6040516020016125c49291906137c1565b60408051601f198184030181529082905262461bcd60e51b8252610a1f91600401612d3e565b60006125fe846001600160a01b0316612483565b156126ee57836001600160a01b031663150b7a0261261a611d01565b8786866040518563ffffffff1660e01b815260040161263c9493929190613830565b6020604051808303816000875af1925050508015612677575060408051601f3d908101601f1916820190925261267491810190613863565b60015b6126d4573d8080156126a5576040519150601f19603f3d011682016040523d82523d6000602084013e6126aa565b606091505b5080516000036126cc5760405162461bcd60e51b8152600401610a1f90613724565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e1b565b506001949350505050565b600080608083901c156127115760809290921c916010015b604083901c156127265760409290921c916008015b602083901c1561273b5760209290921c916004015b601083901c156127505760109290921c916002015b600883901c156106b95760010192915050565b6060600061277283600261338b565b61277d9060026132d0565b6001600160401b0381111561279457612794612ae1565b6040519080825280601f01601f1916602001820160405280156127be576020820181803683370190505b509050600360fc1b816000815181106127d9576127d9613257565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061280857612808613257565b60200101906001600160f81b031916908160001a905350600061282c84600261338b565b6128379060016132d0565b90505b60018111156128af576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061286b5761286b613257565b1a60f81b82828151811061288157612881613257565b60200101906001600160f81b031916908160001a90535060049490941c936128a881613880565b905061283a565b5083156116e05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a1f565b600054610100900460ff16610d875760405162461bcd60e51b8152600401610a1f90613776565b600054610100900460ff1661294c5760405162461bcd60e51b8152600401610a1f90613776565b6097612958838261340a565b506098610ad2828261340a565b600054610100900460ff1661298c5760405162461bcd60e51b8152600401610a1f90613776565b610d87612997611d01565b61225e565b600054610100900460ff166129c35760405162461bcd60e51b8152600401610a1f90613776565b6129e26000805160206138988339815191526129dd611d01565b611f82565b6129fa60008051602061389883398151915284611f82565b612a1260008051602061389883398151915285611f82565b612a1b8261183b565b61010081905561010180546001600160a01b0319166001600160a01b038516179055612a45611d01565b6001600160a01b0316846001600160a01b0316146116755761167584611b11565b60606106b96001600160a01b0383166014612763565b6001600160e01b031981168114610c6957600080fd5b600060208284031215612aa457600080fd5b81356116e081612a7c565b6001600160a01b0381168114610c6957600080fd5b600060208284031215612ad657600080fd5b81356116e081612aaf565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612b1f57612b1f612ae1565b604052919050565b60006001600160401b03831115612b4057612b40612ae1565b612b53601f8401601f1916602001612af7565b9050828152838383011115612b6757600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b8f57600080fd5b6116e083833560208501612b27565b60006001600160401b03821115612bb757612bb7612ae1565b5060051b60200190565b600080600080600060a08688031215612bd957600080fd5b85356001600160401b0380821115612bf057600080fd5b612bfc89838a01612b7e565b9650602091508188013581811115612c1357600080fd5b612c1f8a828b01612b7e565b965050604088013581811115612c3457600080fd5b612c408a828b01612b7e565b95505060608801359350608088013581811115612c5c57600080fd5b88019050601f81018913612c6f57600080fd5b8035612c82612c7d82612b9e565b612af7565b81815260059190911b8201830190838101908b831115612ca157600080fd5b928401925b82841015612cc8578335612cb981612aaf565b82529284019290840190612ca6565b80955050505050509295509295909350565b6001600160a01b0391909116815260200190565b60005b83811015612d09578181015183820152602001612cf1565b50506000910152565b60008151808452612d2a816020860160208601612cee565b601f01601f19169290920160200192915050565b6020815260006116e06020830184612d12565b600060208284031215612d6357600080fd5b5035919050565b60008060408385031215612d7d57600080fd5b8235612d8881612aaf565b946020939093013593505050565b600080600060608486031215612dab57600080fd5b8335612db681612aaf565b95602085013595506040909401359392505050565b60008060408385031215612dde57600080fd5b8235915060208301356001600160401b03811115612dfb57600080fd5b610cb885828601612b7e565b600080600060608486031215612e1c57600080fd5b8335612e2781612aaf565b92506020840135612e3781612aaf565b929592945050506040919091013590565b60008060408385031215612e5b57600080fd5b50508035926020909101359150565b60008060408385031215612e7d57600080fd5b823591506020830135612e8f81612aaf565b809150509250929050565b8415158152836020820152826040820152608060608201526000612ec16080830184612d12565b9695505050505050565b60006020808385031215612ede57600080fd5b82356001600160401b03811115612ef457600080fd5b8301601f81018513612f0557600080fd5b8035612f13612c7d82612b9e565b81815260059190911b82018301908381019087831115612f3257600080fd5b928401925b82841015612f5057833582529284019290840190612f37565b979650505050505050565b600080600060608486031215612f7057600080fd5b833592506020840135612e3781612aaf565b8015158114610c6957600080fd5b60008060408385031215612fa357600080fd5b8235612fae81612aaf565b91506020830135612e8f81612f82565b60008060008060808587031215612fd457600080fd5b8435612fdf81612aaf565b93506020850135612fef81612aaf565b92506040850135915060608501356001600160401b0381111561301157600080fd5b8501601f8101871361302257600080fd5b61303187823560208401612b27565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b82811015613089578151805185528681015187860152850151858501526060909301929085019060010161305a565b5091979650505050505050565b6000602082840312156130a857600080fd5b81356001600160401b038111156130be57600080fd5b611e1b84828501612b7e565b60008060008060008060c087890312156130e357600080fd5b86356130ee81612aaf565b955060208701356130fe81612aaf565b945060408701356001600160401b038082111561311a57600080fd5b6131268a838b01612b7e565b9550606089013591508082111561313c57600080fd5b6131488a838b01612b7e565b9450608089013591508082111561315e57600080fd5b5061316b89828a01612b7e565b92505060a087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b818110156131b75783518352928401929184019160010161319b565b50909695505050505050565b600080604083850312156131d657600080fd5b82356131e181612aaf565b91506020830135612e8f81612aaf565b6001600160a01b0387811682528616602082015260c06040820181905260009061321d90830187612d12565b828103606084015261322f8187612d12565b905082810360808401526132438186612d12565b9150508260a0830152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016132955761329561326d565b5060010190565b600181811c908216806132b057607f821691505b60208210810361171657634e487b7160e01b600052602260045260246000fd5b808201808211156106b9576106b961326d565b60208082526011908201527037b7363c9037333a1037b832b930ba37b960791b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526016908201527527b7363c9037b832b930ba37b91037b91037bbb732b960511b604082015260600190565b80820281158282048414176106b9576106b961326d565b6000826133bf57634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610ad257600081815260208120601f850160051c810160208610156133eb5750805b601f850160051c820191505b818110156124ef578281556001016133f7565b81516001600160401b0381111561342357613423612ae1565b61343781613431845461329c565b846133c4565b602080601f83116001811461346c57600084156134545750858301515b600019600386901b1c1916600185901b1785556124ef565b600085815260208120601f198616915b8281101561349b5788860151825594840194600190910190840161347c565b50858210156134b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60048152631b5a5b9d60e21b602082015260400190565b8481526001600160a01b038416602082015260a0604082018190526000906135099083016134c9565b60ff949094166060830152506080015292915050565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e083016134c9565b60006020828403121561357157600080fd5b81516116e081612f82565b818103818111156106b9576106b961326d565b6004815263313ab93760e11b602082015260400190565b8481526001600160a01b038416602082015260a06040820181905260009061350990830161358f565b84815283602082015260018060a01b038316604082015281606082015260c06080820152600060c082015260e060a08201526000612ec160e0830161358f565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351613653818460208801612cee565b835190830190613667818360208801612cee565b01949350505050565b60008251613682818460208701612cee565b9190910192915050565b60006020828403121561369e57600080fd5b81516116e081612aaf565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516137f3816017850160208801612cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613824816028840160208801612cee565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612ec190830184612d12565b60006020828403121561387557600080fd5b81516116e081612a7c565b60008161388f5761388f61326d565b50600019019056fef7a17991623d7e30ebf9bd089b2f4dcf33b0aa34727454bfa3dbc351ed7d6835ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122058d193dc4a89936faa0836b7c3c9846ab4945e4f6b027433eff0c9a6b5fe9f9a64736f6c63430008110033", "linkReferences": {}, "deployedLinkReferences": {} } From 416a6c42553ca5024af5e3a3bc472c5a976279d7 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 28 Apr 2023 18:15:22 +0200 Subject: [PATCH 4/8] e2e tests clonning --- resources/commands.json | 4 ++-- src/cli.ts | 1 - src/commands/nfts/cloneNft.ts | 2 +- src/utils/utils.ts | 25 ++++++++++++-------- test/helpers/StdoutParser.ts | 9 +++++++ test/integration/NFTs721Subscription.test.ts | 13 ++++++++++ 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/resources/commands.json b/resources/commands.json index 0384663..4ade521 100644 --- a/resources/commands.json +++ b/resources/commands.json @@ -769,7 +769,7 @@ }, { "name": "clone [nftAddress]", "description": "It clones an existing NFT (ERC-721) contract", - "details": "Nevermined Smart Contracts are deployed in a blockchain, with this command it's possible to clone the implementation of an already deployed Smart Contract. The new contract clonned will be owned by the user doing that clonning action.", + "details": "Nevermined Smart Contracts are deployed in a blockchain, with this command it's possible to clone the implementation of an already deployed Smart Contract. The new contract cloned will be owned by the user doing that clonning action.", "examples": ["ncli nfts721 clone 0x37BB53e3d293494DE59fBe1FF78500423dcFd43B --params 'Token Name' --params 'SYMBOL'"], "commandHandler": "cloneNft", "positionalArguments": [{ @@ -1235,7 +1235,7 @@ }, { "name": "clone [nftAddress]", "description": "It clones an existing NFT (ERC-1155) contract", - "details": "Nevermined Smart Contracts are deployed in a blockchain, with this command it's possible to clone the implementation of an already deployed Smart Contract. The new contract clonned will be owned by the user doing that clonning action.", + "details": "Nevermined Smart Contracts are deployed in a blockchain, with this command it's possible to clone the implementation of an already deployed Smart Contract. The new contract cloned will be owned by the user doing that clonning action.", "examples": ["ncli nfts1155 clone 0x37BB53e3d293494DE59fBe1FF78500423dcFd43B --params 'Token Name' --params 'SYMBOL'"], "commandHandler": "cloneNft", "positionalArguments": [{ diff --git a/src/cli.ts b/src/cli.ts index 73219d5..3a26947 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -84,7 +84,6 @@ const cmdHandler = async ( try { if (requiresAccount) { - nvm = await loadNevermined(config, network, verbose) if (!nvm.keeper) process.exit(StatusCodes.FAILED_TO_CONNECT) diff --git a/src/commands/nfts/cloneNft.ts b/src/commands/nfts/cloneNft.ts index 39f1825..7f0fda1 100644 --- a/src/commands/nfts/cloneNft.ts +++ b/src/commands/nfts/cloneNft.ts @@ -55,7 +55,7 @@ export const cloneNft = async ( ) } - logger.info(`Contract clonned into address: ${clonnedAddress}\n`) + logger.info(`Contract cloned at address: ${clonnedAddress}\n`) return { status: StatusCodes.OK, diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 8b500d5..727f50b 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -28,18 +28,23 @@ export const loadNevermined = async ( network: string, verbose = false ): Promise => { - - const nvm = await Nevermined.getInstance({ - ...config.nvm, - verbose: verbose ? verbose : config.nvm.verbose - }) - if (!nvm.keeper) { - logger.error( - chalk.red(`ERROR: Nevermined could not connect to '${network}'\n`) - ) + try { + logger.log(JSON.stringify(config.nvm.web3ProviderUri)) + const nvm = await Nevermined.getInstance({ + ...config.nvm, + verbose: verbose ? verbose : config.nvm.verbose + }) + if (!nvm.keeper) { + logger.error( + chalk.red(`ERROR: Nevermined could not connect to '${network}'\n`) + ) + } + return nvm + } catch (error) { + logger.error(chalk.red(`ERROR: ${(error as Error).message}\n`)) + process.exit(1) } - return nvm } export const loginMarketplaceApi = async ( diff --git a/test/helpers/StdoutParser.ts b/test/helpers/StdoutParser.ts index ac82fd3..9cbd567 100644 --- a/test/helpers/StdoutParser.ts +++ b/test/helpers/StdoutParser.ts @@ -11,6 +11,7 @@ export const commandRegex = { }, nfts: { deploy: new RegExp('.*Contract deployed into address: (.{42}).*', 'gm'), + clone: new RegExp('.*Contract cloned at address: (.{42}).*', 'gm'), create: new RegExp('.*Created DID: (.{71}).*', 'gm'), publishMetadata: new RegExp('.*NFT Metadata Created: (.*)', 'gm'), order: new RegExp('.*NFT Agreement Created: (.{66})', 'g') @@ -158,3 +159,11 @@ export const parseAddressOfContractDeployed = (stdout: string): string => { } return '' } + +export const parseAddressOfContractCloned = (stdout: string): string => { + const parsed = commandRegex.nfts.clone.exec(stdout) + if (parsed != null) { + return parsed[1] + } + return '' +} diff --git a/test/integration/NFTs721Subscription.test.ts b/test/integration/NFTs721Subscription.test.ts index f5673af..36b359a 100644 --- a/test/integration/NFTs721Subscription.test.ts +++ b/test/integration/NFTs721Subscription.test.ts @@ -1,5 +1,6 @@ import { execOpts, baseCommands } from '../helpers/Config' import { + parseAddressOfContractCloned, parseAddressOfContractDeployed, parseDIDFromNewNFT, parseNFTOrderAgreementId @@ -42,6 +43,18 @@ describe('Subscription NFTs (ERC-721) e2e Testing', () => { expect(nftAddress === '' ? false : nftAddress.startsWith('0x')) }) + test('Clone an existing NFT (ERC-721) Subscription contract with parameters', async () => { + const cloneCommand = `${baseCommands.nfts721.clone} ${nftAddress} --accountIndex 0` + console.debug(`COMMAND: ${cloneCommand}`) + + const stdout = execCommand(cloneCommand, execOpts) + + console.debug(`STDOUT: ${stdout}`) + nftAddress = parseAddressOfContractCloned(stdout) + console.debug(`Subscription Nft Address: ${nftAddress}`) + expect(nftAddress === '' ? false : nftAddress.startsWith('0x')) + }) + test('Register a Subscription NFT (ERC-721)', async () => { const registerAssetCommand = `${baseCommands.nfts721.create} ${nftAddress} --metadata test/resources/metadata-subscription.json --subscription true --duration 50000 --transfer false --services nft-sales` console.debug(`COMMAND: ${registerAssetCommand}`) From 3ca170645c63affd7122eee4fec38e06ccbbca4b Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 28 Apr 2023 18:27:33 +0200 Subject: [PATCH 5/8] cloning including transfer condition --- src/commands/nfts/cloneNft.ts | 26 ++++++++++++++++---- test/integration/NFTs721Subscription.test.ts | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/commands/nfts/cloneNft.ts b/src/commands/nfts/cloneNft.ts index 7f0fda1..0af16cd 100644 --- a/src/commands/nfts/cloneNft.ts +++ b/src/commands/nfts/cloneNft.ts @@ -16,10 +16,12 @@ export const cloneNft = async ( logger: Logger ): Promise => { - const { nftAddress, nftType } = argv + const { nftAddress } = argv logger.info(chalk.dim(`Clonning NFT contract from address ${nftAddress}...`)) + const nftType = Number(argv.nftType) === 721 ? 721 : 1155 + if (!ethers.utils.isAddress(nftAddress)) return { status: StatusCodes.ERROR, @@ -27,13 +29,25 @@ export const cloneNft = async ( } const operators: string[] = [] + argv.operators.forEach((_operator: string) => { if (ethers.utils.isAddress(_operator)) operators.push(_operator) }) let clonnedAddress - if (nftType == 721) { + logger.debug(`Clonning NFT-${nftType} using params:`) + logger.debug(`\tName: ${argv.name}`) + logger.debug(`\tSymbol: ${argv.symbol}`) + logger.debug(`\tURI: ${argv.uri}`) + logger.debug(`\tCap: ${argv.cap}`) + + if (nftType === 721) { + if (!operators.includes(nvm.keeper.conditions.transferNft721Condition.getAddress())) + operators.push(nvm.keeper.conditions.transferNft721Condition.getAddress()) + + logger.debug(`\tOperators: ${JSON.stringify(operators)}`) + await nvm.contracts.loadNft721(nftAddress) clonnedAddress = await nvm.nfts721.getContract.createClone( argv.name, @@ -44,12 +58,14 @@ export const cloneNft = async ( creatorAccount ) } else { - await nvm.contracts.loadNft721(nftAddress) - clonnedAddress = await nvm.nfts721.getContract.createClone( + if (!operators.includes(nvm.keeper.conditions.transferNftCondition.getAddress())) + operators.push(nvm.keeper.conditions.transferNftCondition.getAddress()) + + await nvm.contracts.loadNft1155(nftAddress) + clonnedAddress = await nvm.nfts1155.getContract.createClone( argv.name, argv.symbol, argv.uri, - BigNumber.from(argv.cap), operators, creatorAccount ) diff --git a/test/integration/NFTs721Subscription.test.ts b/test/integration/NFTs721Subscription.test.ts index 36b359a..64f22d5 100644 --- a/test/integration/NFTs721Subscription.test.ts +++ b/test/integration/NFTs721Subscription.test.ts @@ -44,7 +44,7 @@ describe('Subscription NFTs (ERC-721) e2e Testing', () => { }) test('Clone an existing NFT (ERC-721) Subscription contract with parameters', async () => { - const cloneCommand = `${baseCommands.nfts721.clone} ${nftAddress} --accountIndex 0` + const cloneCommand = `${baseCommands.nfts721.clone} ${nftAddress} --accountIndex 0 --name "NVM Subscription" --symbol "NVM" --cap 0` console.debug(`COMMAND: ${cloneCommand}`) const stdout = execCommand(cloneCommand, execOpts) From 5f9f8361e1cd8a1a43378a7267d81f2a093b0524 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 2 May 2023 15:08:43 +0200 Subject: [PATCH 6/8] using latest contracts --- .github/workflows/testing.yml | 2 +- resources/networks.json | 6 +++--- test/integration/NFTs721Subscription.test.ts | 12 ------------ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c36eb9d..3c4430b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -30,7 +30,7 @@ jobs: token: ${{ secrets.API_TOKEN_GITHUB }} opengsn: 'true' estuary: 'true' - contracts-version: 'v3.1.0' + contracts-version: 'v3.2.1' - name: Check artifacts and circuits run: | nvm-tools copy-artifacts /tmp/.nevermined/artifacts diff --git a/resources/networks.json b/resources/networks.json index 91607f2..ed686d8 100644 --- a/resources/networks.json +++ b/resources/networks.json @@ -14,7 +14,7 @@ "nativeToken": "MATIC", "networkId": "80001", "networkName": "mumbai", - "contractsVersion": "3.1.0", + "contractsVersion": "3.2.1", "tagName": "public", "etherscanUrl": "https://mumbai.polygonscan.com", "erc20TokenAddress": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62", @@ -192,7 +192,7 @@ "nativeToken": "MATIC", "networkId": "80001", "networkName": "mumbai", - "contractsVersion": "3.1.0", + "contractsVersion": "3.2.1", "tagName": "public", "etherscanUrl": "https://mumbai.polygonscan.com", "erc20TokenAddress": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62", @@ -215,7 +215,7 @@ "nativeToken": "MATIC", "networkId": "80001", "networkName": "mumbai", - "contractsVersion": "3.1.0", + "contractsVersion": "3.2.1", "tagName": "public", "etherscanUrl": "https://mumbai.polygonscan.com", "erc20TokenAddress": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62", diff --git a/test/integration/NFTs721Subscription.test.ts b/test/integration/NFTs721Subscription.test.ts index 64f22d5..91ace86 100644 --- a/test/integration/NFTs721Subscription.test.ts +++ b/test/integration/NFTs721Subscription.test.ts @@ -17,19 +17,7 @@ describe('Subscription NFTs (ERC-721) e2e Testing', () => { let nftAddress = '' let orderAgreementId = '' - beforeAll(async () => { - try { - console.log(`Funding account: ${execOpts.accounts[0]}`) - const fundCommand = `${baseCommands.accounts.fund} "${execOpts.accounts[0]}" --token erc20` - console.debug(`COMMAND: ${fundCommand}`) - execCommand(fundCommand, execOpts) - } catch { - console.error('Unable to fund account') - } - - }) - test('Deploy a new NFT (ERC-721) Subscription contract with parameters', async () => { const deployCommand = `${baseCommands.nfts721.deploy} ${abiPathSubscription} --accountIndex 0 --params "Token Name" --params Symbol --addMinter true ` console.debug(`COMMAND: ${deployCommand}`) From 86203588be71c0acee2f6718aff60aff30b72f01 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 2 May 2023 15:41:35 +0200 Subject: [PATCH 7/8] using a NFT contract that can be cloned --- test/integration/NFTs721.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/NFTs721.test.ts b/test/integration/NFTs721.test.ts index a6f1662..a66a178 100644 --- a/test/integration/NFTs721.test.ts +++ b/test/integration/NFTs721.test.ts @@ -11,7 +11,7 @@ import execCommand from '../helpers/ExecCommand' import { didZeroX } from '@nevermined-io/sdk' describe('NFTs (ERC-721) e2e Testing', () => { - const abiPath = 'test/resources/nfts/TestNFT721.json' + const abiPath = 'test/resources/nfts/NFT721SubscriptionUpgradeable.json' let did = '' let orderAgreementId = '' let nftAddress = '' From a0e48555b48ff385754a3c25f5d553378e382f6b Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Tue, 2 May 2023 16:54:20 +0200 Subject: [PATCH 8/8] fixing example --- resources/commands.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/commands.json b/resources/commands.json index 4ade521..dca4d82 100644 --- a/resources/commands.json +++ b/resources/commands.json @@ -1425,7 +1425,7 @@ "name": "balance [nftAddress] [did]", "description": "It gets the balance of a NFT", "details": "This command allows to check if an address is a holder of a specific NFT wrapped by a Nevermined DID", - "examples": ["ncli nfts1155 hold did:nv:afd733c23c41af948be7ec039c3fb2048d437e082a69ea3f336cdf452a49be7e"], + "examples": ["ncli nfts1155 balance 0xF841Ff2C8abF1751A83923755EbD2F66bBAa5BFE did:nv:afd733c23c41af948be7ec039c3fb2048d437e082a69ea3f336cdf452a49be7e"], "commandHandler": "balanceNft", "positionalArguments": [{ "name": "nftAddress",